Setting Unicode list markers

General TRichView support forum. Please post your questions here
Post Reply
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Setting Unicode list markers

Post by martindholmes » Fri Sep 16, 2005 3:26 pm

Hi there,

I'm struggling to understand exactly how list markers such as bullets work. I've been looking at the BulletsAndNumbering demo, and in the code below, it seems that the bullet is created using the Symbol font and charset. I obviously want to avoid this, because these are not Unicode. I can obviously choose a Unicode font here, but I don't see where I could set the actual character itself which is used as the bullet. I'd like to be able to set a series of Unicode characters as bullets in my list styles -- for example these:

u2022 (bullet)
u2023 (triangular bullet)
u25c6 (black diamond)
u25c8 (white diamond)
u2043 (hyphen bullet)
u2219 (bullet operator)
u25d8 (inverse bullet)
u25e6 (white bullet)

Using these Unicode characters, I can ensure that my documents stay compliant, and take advantage of a range of different bullet styles without using images. But I don't see how to choose the character I want for my bullet. Can this be done? If not, how does the TRichView choose its character?

function TForm1.CreateBullets: Integer;
var ListStyle: TRVListInfo;
// 1. Creating desired list style
ListStyle := TRVListInfo.Create(nil);
with ListStyle.Levels.Add do begin
ListType := rvlstBullet;
Font.Name := 'Symbol';
Font.Charset := SYMBOL_CHARSET;
Font.Size := 12;
FirstIndent := 0;
LeftIndent := 24;
// 2. Searching for existing style with these properties. Creating it, if not found
Result := RVStyle1.ListStyles.FindSuchStyle(ListStyle, True);


Sergey Tkachenko
Site Admin
Posts: 14776
Joined: Sat Aug 27, 2005 10:28 am

Post by Sergey Tkachenko » Fri Sep 16, 2005 4:18 pm

ListType := rvlstUnicodeBullet;
FontName := <font with exotic characters>
FormatStringW := <exotic character>

Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes » Fri Sep 16, 2005 4:21 pm

Thanks Sergey! That's what I needed.


Post Reply