[Lazarus] EasyLazFreeType demo not working

Ondrej Pokorny lazarus at kluug.net
Sat Apr 9 20:24:29 CEST 2016


On 09.04.2016 20:15, Jesus Reyes A. wrote:
> En Sat, 09 Apr 2016 12:50:42 -0500, Ondrej Pokorny <lazarus at kluug.net> 
> escribió:
>
>> I test the EasyLazFreeType from lazutils package. I cannot make the 
>> example work (in directory examples\lazfreetype).
>>
>> The actual problem is in TFreeTypeFont.LoadFace line "familyItem := 
>> Collection.Family[FName];" where Collection is nil (the 
>> FontCollection global variable in EasyLazFreeType is nil).
>> I downloaded all font files and placed them into the directory, they 
>> are correctly loaded.
>>
>> Can somebody help? :)
>>
>> Ondrej
>>
>
> It runs here if I give to it three arguments in command line, example:
>
> lazfreetypetest.exe fonts\arial.ttf fonts\timesi.ttf fonts\verdana.ttf
>
> of course I created the directory fonts and put there the ttf files.
>
> If you don't run it this way, it tries to get the fonts from some kind 
> of font manager but has that is not initialized and it fails, at least 
> that is what I remember.

Of course I gave it 3 fonts in the arguments. But I used different fonts 
(from fp-pdf example: FreeSans.ttf, Ubuntu-R.ttf, DejaVuSans.ttf), not 
the default ones.

I found the problems and fixed them in r52152
1.) Missing LazFreeTypeFontCollection unit.
2.) Missing registering of font in FontCollection.
3.) Wrong result.Name value in TForm1.SetupFonts/LoadFont.

Now it works for me. Please report if I broke something.

Ondrej




More information about the Lazarus mailing list