Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-04

EasyLazFreeType demo not working

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ondrej Pokorny

I test the EasyLazFreeType from lazutils package. I cannot make the example work (in directory examples\lazfreetype).

It stops with this stack trace:
#0 HANDLEERRORADDRFRAME(44954876, 0x2adf500, 0x2adf590) at P:\software\FPC\trunk_src\rtl\inc\system.inc:1133
#1 HANDLEERRORADDRFRAMEIND(210, 0x576820, 0x2adf590) at P:\software\FPC\trunk_src\rtl\inc\system.inc:1152
#2 fpc_objecterror at P:\software\FPC\trunk_src\rtl\inc\system.inc:741 #3 LOADFACE(0x2c5c590) at easylazfreetype.pas:858
#4 CHECKFACE(0x2c5c590) at easylazfreetype.pas:1862 #5 FETCHNAMES(0x2c5c590) at easylazfreetype.pas:1815 #6 GETINFORMATION(0x2c5c590, FTIFULLNAME) at easylazfreetype.pas:1007 #7 TFORM1__FORMPAINT(0x2c1c030, <error reading variable>) at mainform.pas:192
#8 PAINT(0x2c1c030) at include\customcontrol.inc:73 #9 PAINTWINDOW(0x2c1c030, 738278591) at include\customform.inc:1111 #10 PAINTHANDLER(0x2c1c030, {MSG = 15, DC = 738278591, PAINTSTRUCT = 0x2adfad0, RESULT = 0}) at include\wincontrol.inc:4801 #11 WMPAINT(0x2c1c030, {MSG = 15, DC = 738278591, PAINTSTRUCT = 0x2adfad0, RESULT = 0}) at include\wincontrol.inc:6754 #12 WMPAINT(0x2c1c030, {MSG = 15, DC = 738278591, PAINTSTRUCT = 0x2adfad0, RESULT = 0}) at include\customcontrol.inc:106 #13 TOBJECT__DISPATCH(void, <error reading variable>) at P:\software\FPC\trunk_src\rtl\inc\objpas.inc:602
#14 WNDPROC(0x2c1c030, {MSG = 15, WPARAM = 738278591, LPARAM = 44956368, RESULT = 0, WPARAMLO = 15551, WPARAMHI = 11265, WPARAMFILLER = {}, LPARAMLO = 64208, LPARAMHI = 685, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}) at include\control.inc:2100 #15 WNDPROC(0x2c1c030, {MSG = 15, WPARAM = 738278591, LPARAM = 44956368, RESULT = 0, WPARAMLO = 15551, WPARAMHI = 11265, WPARAMFILLER = {}, LPARAMLO = 64208, LPARAMHI = 685, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}) at include\wincontrol.inc:5386 #16 WNDPROC(0x2c1c030, {MSG = 15, WPARAM = 738278591, LPARAM = 44956368, RESULT = 0, WPARAMLO = 15551, WPARAMHI = 11265, WPARAMFILLER = {}, LPARAMLO = 64208, LPARAMHI = 685, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}) at include\customform.inc:1455 #17 DELIVERMESSAGE(0x2c1c030, 0) at lclmessageglue.pas:112 #18 SENDPAINTMESSAGE(0x2c4c280, 0) at win32\win32callback.inc:696 #19 DOWINDOWPROC(0x2c4c280) at win32\win32callback.inc:2198 #20 WINDOWPROC(2760662, 15, 0, 0) at win32\win32callback.inc:2590 #21 CUSTOMFORMWNDPROC(2760662, 15, 0, 0) at win32\win32wsforms.pp:386 #22 USER32!SetMessageQueue at :0
#23 USER32!CancelShutdown at :0
#24 USER32!DlgDirListComboBoxW at :0
#25 USER32!PrivateExtractIconExA at :0
#26 ?? at :0
#27 USER32!DlgDirListComboBoxW at :0
#28 APPPROCESSMESSAGES(0x2c378f0) at win32\win32object.inc:407 #29 HANDLEMESSAGE(0x2bdfd40) at include\application.inc:1262 #30 RUNLOOP(0x2bdfd40) at include\application.inc:1399 #31 INTERFACEBASE$_$TWIDGETSET_$__$$_APPRUN$TAPPLICATIONMAINLOOP at :0 #32 RUN(0x2bdfd40) at include\application.inc:1387 #33 :17

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

Reply by email

Jesus Reyes A.
to Ondrej Pokorny

En Sat, 09 Apr 2016 12:50:42 -0500, Ondrej Pokorny escribi?:

Show quoted text 13 lines
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.

Jesus Reyes A.

Reply by email

Ondrej Pokorny
to Jesus Reyes A.
Jesus Reyes A. wrote 26 lines
En Sat, 09 Apr 2016 12:50:42 -0500, Ondrej Pokorny 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

Reply by email