Link to home
Start Free TrialLog in
Avatar of LeTay
LeTay

asked on

Special font in Delphi XE2, TLabel

I want to use a special font, like DS-DIGIB for caption in TLabel
It is not currently available.
Is it possible to implement it ?
This URL shows examples of what I need : http://www.dafont.com/theme.php?cat=302
Avatar of Geert G
Geert G
Flag of Belgium image

just install the font in the windows environment

> add the font to c:\windows\fonts
Avatar of LeTay
LeTay

ASKER

Will try that !
If your application is going to work outside your workstation, probably distributed to clients, then you are going to need to supply that font along with your application and use AddFontResource() to make it available before it was used.

Edit:
Do not miss the valuable info at the bottom of the link:
Remarks

Any application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system. The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.

When an application no longer needs a font resource that it loaded by calling the AddFontResource function, it must remove that resource by calling the RemoveFontResource function.

This function installs the font only for the current session. When the system restarts, the font will not be present. To have the font installed even after restarting the system, the font must be listed in the registry.

A font listed in the registry and installed to a location other than the %windir%\fonts\ folder cannot be modified, deleted, or replaced as long as it is loaded in any session. In order to change one of these fonts, it must first be removed by calling RemoveFontResource, removed from the font registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts), and the system restarted. After restarting the system, the font will no longer be loaded and can be changed.
Also you could add the font as resource from Delphi menu, go to Project -> Resources and images ... and locate the font file.
For such "led" type fonts - it is better to use special components like Jedi's TJvSegmentedLEDDisplay, TJvDigits .. and be font depending ... More on Torry.net
or https://www.tmssoftware.com/site/advsmoothledlabel.asp
Avatar of LeTay

ASKER

I put the font file in my project's directory
Now I can't see it in the font list of my TLabel component
What did I miss ?
ASKER CERTIFIED SOLUTION
Avatar of jimyX
jimyX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
because the os doesn't look there for any fonts

searching all directories on a windows machine will take a long while to find all existing fonts
a general approach for apps taking minutes to load something ... is to kill the app and try again

put the font in c:\windows\fonts
Did you try my suggestion ... until now you would have working solution/form. Special LED components looks better than special LED font.
Avatar of LeTay

ASKER

Sorry, I was travelling for the last three weeks.
I will have a look at your proposal this sunday
Thanks