- This topic has 41 replies, 2 voices, and was last updated 6 years, 1 month ago by HeDiBo.
-
AuthorPosts
-
July 5, 2018 at 4:17 pm #37885HeDiBoParticipant
The editor of TsCharImageList should allow in Add Fonts loading of OTF files too. Not just TTF files.
July 9, 2018 at 12:14 pm #58118SupportKeymasterThere is a problem exists – I have no idea how to receive a font name from the OTF file.
You can see the acGetFontName function which used for extracting of a font name.
This name used in the design-time editor for showing of list of loaded fonts.
This name used by developer later when defined Font.Name property.
But, I don't know a way for receiving of font name from OTF files, unfortunately.
July 9, 2018 at 4:08 pm #58122HeDiBoParticipant'Support' wrote:There is a problem exists – I have no idea how to receive a font name from the OTF file.
You can see the acGetFontName function which used for extracting of a font name.
This name used in the design-time editor for showing of list of loaded fonts.
This name used by developer later when defined Font.Name property.
But, I don't know a way for receiving of font name from OTF files, unfortunately.
I've made up a sample project, that will show a font name for a TTF file and for an OTF file. You don't have to know anything about the internal structure of the font file: [attachment=8808:GetPrivateFontInfo.zip].
I must admit it cost me quite some time to find these hidden font functions.
July 9, 2018 at 5:13 pm #58123SupportKeymasterThank you!
Many OTF fonts can't be processed by this way, seems. But I will research it, maybe I will find something too.
Some fonts which can't be processed are attached here for tests.
Returned status – FileNotFound.
July 9, 2018 at 8:45 pm #58124HeDiBoParticipant'Support' wrote:Thank you!
Many OTF fonts can't be processed by this way, seems. But I will research it, maybe I will find something too.
Some fonts which can't be processed are attached here for tests.
Returned status – FileNotFound.
I could open and retrieve all font names from your sample.
Don't know what happened at your side.
I added my exe file for you to test.
PS. Please delete it again, it takes up almost all my remaining space
July 9, 2018 at 8:59 pm #58125HeDiBoParticipantHere is a picture of three runs of my program with your fonts:
[attachment=8811:3FontSamples.jpg]
July 10, 2018 at 5:25 am #58126SupportKeymasterMaybe it's depended from OS, I will check it more on different systems.
In my system (Win7 x64), these fonts were not loaded in your application with 'FileNotFound' status.
July 10, 2018 at 9:18 am #58128HeDiBoParticipant'Support' wrote:Maybe it's depended from OS, I will check it more on different systems.
In my system (Win7 x64), these fonts were not loaded in your application with 'FileNotFound' status.
When one of the GPFont calls fails, I give a message with a status. What status did you get?
July 10, 2018 at 9:56 am #58129HeDiBoParticipantThe call PrivateFonts.AddFontFile needs a widestring for the filename.
Maybe that's the cause for trouble on some development environments.
I changed it, so you can have another try: [attachment=8812:GetPrivateFontInfo.zip]
July 10, 2018 at 1:36 pm #58131HeDiBoParticipantI also found out it is impossible to use the standard font directory (C:WindowsFonts). It cannot find any file there.
Maybe that's what bothered you.
But that's not an issue, because you cannot add fonts from the system fonts anyway (in Add Fonts you cannot choose C:WIndowsFonts)
PS. The original post spoke of TsFontStore. That should have been TsCharImageList. I've corrected the message accordingly.
July 10, 2018 at 1:52 pm #58132HeDiBoParticipantI found out that, in order to access system fonts as ordinary files, you have to go through an UNC name.
So select the fonts directory by going to the network button and selecting the drive C share, etc. Ending up with \computer-namec$WindowsFonts
July 11, 2018 at 10:01 am #58133HeDiBoParticipantI modified the original program, to enable listing all family names in a given directory.
[attachment=8813:GetPrivateFontInfo.zip]
Also I made a new project that lists all standard system font families, using the same technique.
[attachment=8816:GetSystemFontInfo.zip]
July 11, 2018 at 5:29 pm #58135SupportKeymasterThank you for programs. What is your Windows version?
I have installed these fonts in the OS, but FileNotFound (10) status occurs still…
I have found info in the net, that some Otf file has problems with Windows 7
July 11, 2018 at 5:34 pm #58136HeDiBoParticipant'Support' wrote:Thank you for programs. What is your Windows version?
I have installed these fonts in the OS, but FileNotFound (10) status occurs still…
You are probably trying to load them from the system font directory (C:WindowFonts). I addressed that problem in an earlier post. Have a look there.
I'm working with Windows 10 64bit.
I'm now working on a version that will give the real font name, next to the family name.
July 11, 2018 at 5:39 pm #58137SupportKeymasterFirst tries of loading were from “e:DesignFontsRegularBad” folder.
Later I have copied some fonts to “c:WindowsFonts” – same problem.
Some fonts were installed after that – same problem…
Windows 10 (on virtual machine) works well with all fonts.
PS. Even more, these fonts are installed, but doesn't work under Windows 7
July 11, 2018 at 5:43 pm #58138HeDiBoParticipant'Support' wrote:First tries of loading were from “e:DesignFontsRegularBad” folder.
Later I have copied some fonts to “c:WindowsFonts” – same problem.
Some fonts were installed after that – same problem…
Windows 10 (on virtual machine) works well with all fonts.
If you set the directory to e:DesignFontsRegularBad and click the “List Family Names” button, do you see the font families? If not, what do you see?
July 11, 2018 at 5:44 pm #58139SupportKeymaster'HeDiBo' wrote:If you set the directory to e:DesignFontsRegularBad and click the “List Family Names” button, do you see the font families? If not, what do you see?
I see error message with status = 10 (FileNotFound).
And, these fonts are installed, but doesn't work under Windows 7 at all.
July 11, 2018 at 5:46 pm #58140HeDiBoParticipant'Support' wrote:I see error message with status = 10 (FileNotFound).
And, these fonts are installed, but doesn't work under Windows 7 at all.
I don't understand the File Not Found error.
Can you provide a screenshot of the main window and of the error message?
July 11, 2018 at 5:48 pm #58141SupportKeymasterScreenshot is attached
This status occurs after “Status := PrivateFonts.AddFontFile(widename);”
July 11, 2018 at 5:52 pm #58142HeDiBoParticipant'Support' wrote:Screenshot is attached
This status occurs after “Status := PrivateFonts.AddFontFile(widename);”
The directory used for the font is the windows font directory (the filename says so). That doesn't work.
Try clicking the “List Family Names” button at the right top of the window.
-
AuthorPosts
- You must be logged in to reply to this topic.