TCustomFreeTypeFontCollection Enumerator lazarus / 31-LCL ---------------------------------------------------------------------- ϻαϻɾΣɀО · 2019-06-01 20:02 Hi Guys, For the TCustomFreeTypeFontCollection there are two enumerators: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i         function FontFileEnumerator: IFreeTypeFontEnumerator; virtual; abstract;    function FamilyEnumerator: IFreeTypeFamilyEnumerator; virtual; abstract;  But I cannot figure out how to use them! Can someone help me? ---------------------------------------------------------------------- ϻαϻɾΣɀО · 2019-06-01 20:51 I found something like this and it works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetFontFamilies: TStringList;var  enm: IFreeTypeFamilyEnumerator;begin    Result := TStringList.Create;    enm := FontCollection.FamilyEnumerator;    while enm.MoveNext do      Result.Add(enm.Current.FamilyName);end; any beter suggestion? I mean something like Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  for family in FontCollection do... ---------------------------------------------------------------------- jamie · 2019-06-01 22:27 Yes you fingered it out  You can even write your enumerators in your classes that you make, all you need is the GetEnumerator function That allows the loop counter using "IN" to function. http://wiki.freepascal.org/for-in_loop ---------------------------------------------------------------------- devEric69 · 2019-06-02 07:53 Nice insight. And just as a reminder, for those who are "paranoid" and want to free the memory by themselves, once the interface is used (without letting the interfaces's _refcount do its job as a "garbage collector"), you must assign the interface's variable with nil to free it, like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GetFontFamilies function: TStringList;begin        .../...        enm:= nil;  //free the intrfc expresslyend;