Embedding a font in delphi

后端 未结 2 1235
挽巷
挽巷 2020-12-15 21:47

I\'m working on an app that requires a particular barcode true type font that is unlikely to be on the user\'s PC.

Can I somehow embed the font in the app, or do I

2条回答
  •  情歌与酒
    2020-12-15 22:08

    Yes, you can save it as a resource in the EXE file, and on user's pc, you can extract it as a file using a TResourceStream instance. Then you can call AddFontResource API function. At last, you should send a WM_FONTCHANGE message to all top-level windows in the system (Check Remark section of AddFontResource description in MSDN website).

    If you need an example code, let me know.

提交回复
热议问题