Setting Unicode list markers

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

Setting Unicode list markers

Post by martindholmes »

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?

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

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

ListType := rvlstUnicodeBullet;
FontName := <font with exotic characters>
FormatStringW := <exotic character>
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

Thanks Sergey! That's what I needed.

Cheers,
Martin
Post Reply