LMD-Tools Font Image List Guide


TLMDFontItems


type

  TLMDFontItems = class(TOwnedCollection);

 

The type is used as a type of TLMDFontCollection.Items property to represent the collections's fonts. At design time can be filled with items via font collection component editor. At run-time allows to Add, Move or Delete items, as well, as enumerating icons via Count and Items[Index] properties.

 

BeginUpdate/EndUpdate methods can be used for performance optimization when in case of many simultaneous collection modifications.

 

function Add: TLMDFontItem;

function Add(AStream: TStream; 

             AFormat: TLMDFontFormat): TLMDFontItem;

function Add(const AFileName: string): TLMDFontItem;

Creates and adds new font item to the font collection. The first method returns an empty item, while the other two overloads call the corresponding Item.Load methods internally to fill newly created item with the font data.

function Insert(Index: Integer): TLMDFontItem;

Creates and adds new empty font item to the font collection. The item is added into the collection at Index position. Method returns newly created item.

procedure Delete(Index: Integer);

Deletes the item at Index position.

procedure Clear;

Deleted all items from the collection.

property Count: Integer;

Returns the count of collection items.

function TryGet(const AFontName: string; 

                out AItem: TLMDFontItem): Boolean;

Searches and returns a font item by specified AFontName name. If the item is found the method returns True, and the item reference is assigned to out AItem parameter. Otherwise the method returns False.

property Items[Index: Integer]: TLMDFontItem;

Along with the Count property the Items allows to iterate font collection items.

procedure BeginUpdate;

procedure EndUpdate;

Allows to deffer internal re-calculations and linked components notifications until the end of the multpile collection modifications.