Jump to content
Registration disabled at the moment Read more... ×
Marty001

Load font into TStringlist

Recommended Posts

I have a Font (ttf) added to my resource file, It is a graphical in-house font that has icons for Tbutton etc, however is there a way to add the font to a TImageList? so that each character is a separate image?

 

Using Delphi 11.2 on Windows 11 Pro 64bit

Edited by Marty001

Share this post


Link to post

This article explain how to use a font without installing it. This is not Delphi but make almost only use of Windows API which you can use from Delphi. Once the font is loaded, you can use it to paint individual characters to bitmaps and add them to TImageList.

Share this post


Link to post

Remember that font glyphs are usually vector images and so rasterising into an image list may not be ideal, depending on your usage. My guess is that rasterising every glyph from a font ahead of time is terribly wasteful. You may run out of resources. Why don't you just draw each glyph on demand when you need to? 

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×