This way of getting the font list allows you to filter out the suitable types (tt/otf etc)
You could query with the native Xojo RegistryItem and work out what is useful to you there?
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s
Screenshot from the actual registry:
Also there is a discrepancy for some of the font names, with the @ I believe is something to do with multiple character fonts. Am I expected to break the fonts by & from the registry to match up with other programs, like word or wordpad?
The fonts prefixed with @ are related to vertical CJK text.
haters gonna hate.
dude, 4 replies to this topic that you have nothing to do with, get a life
there was a time when one could read flagged post, not anymore ? just for the fun to read
Unfortunately, its a bit of a clusterfuck. As you have discovered, GDI, GDI+ and Direct2D/Direct Draw support the various font types differently and a newer API doesn’t mean support for more font types.
You can find out a font type by enumerating the fonts using declares or if you have MBS, you can use WindowsFontFamilyMBS. This should tell you if a font is one of the following:
• Raster Font
• Postscript Type 1 Font
• TrueType Font
• OpenType Font
After that I think you are on your own as your code will have to call the necessary text drawing functions based on the font type. The Xojo framework should be doing this but it could be that William assumed the latest APIs would handle everything.
I think he took his ball and went home … again.
I can’t answer You on this what I would answer. It wasn’t off topic cause the only solution is still to write a plugin component for dojo. Why that is flagged? Dunno. But I am not outa here. For you as info: you may never reach the right point while you have no idea. (Arthur Conan Doyle) fits for you so much.
Hoping I can avoid writing a plugin
But that has yet to be determined
Terrible idea that I’m not pleased came to mind…
what about DrawInto? Fill the text into a text area and draw it into the canvas…
I uh, completely undid that UI-reliant method for a project to improve its speed and threadability, but could it work for you?
Download the free version of PureBasic and compile this:
#FILE_ID = 0
Global NewList FontNames.s()
Procedure EnumFontCallback(*lf.ENUMLOGFONT, *tm, FontType, lParam)
If FontType = 4 And *lf\elfLogFont\lfOutPrecision = 3
sFont$ = PeekS(@*lf\elfLogFont\lfFaceName)
If Not FindString(sFont$, "@")
FontNames() = sFont$
hWnd = GetDesktopWindow_()
hDC = GetDC_(hWnd)
EnumFontFamilies_(hDC, 0, @EnumFontCallback(), 0)
If OpenFile(#FILE_ID, "fonts.txt")
Then you can just run the *.exe and it should create a text file listing the available TrueType fonts and then terminate.
@npalardy final step afterwards: buy PureBasic and uninstall Xojo …
Everybody should buy PureBasic, it’s a very useful bargain even if you just use it for small utilities
Its a way I would go with C or C++ also, no question. I guess, there is not that much difference. The chance inside is always to get fast and small exe’s or linux macOS binaries. That’s the nice part on Languages like C and C++ while XPlat.
Did you forget Java on purpose?
I did not forget ava my Dear. The Point is that I mentioned it much before. And nobody wants to read about it. That’s okay while there are languages in the same class like Java usable in this case and also: for free. And you can build that Stuff with Netbeans also for: free.
A plugin would possibly address my needs
A helper exe might as well
I have several avenues to explore
None of which is “rewrite your app in something that doesnt have this issue”
This shouldnt exist
in part because MS has several apis that can use fonts and they are vastly different in capabilities and what fonts each can and cannot use
AND because the abstraction that Xojo provides doesnt
abstracts you from the platform details allowing you to focus your time and energy on what makes your app unique.
I’ve spent way more time futzing about trying to figure out which fonts I can use in the way I want / need than is really practical because they dont expose a font object where I can just ask “can I use this font in a text area ?” or “can I use this in this kind of picture ?” or “can I use this in this graphics paint event ?”
instead I’m having to invent this
or do jurgs workaround so a single api is used every where
Sounds like a charm. Okay, I would write a plugin which provides me a working textObject and a working Canvas. Language: doesn’t matter, should be able to do the Job. And then having Xojo Components which you can use. Should be possible to do.
Using then the API of the self made components and showing Windows and Xojo the middle finger.
Only what I would do. When I look on the time you had to waste until now: I would bet you can do that Job as fast as you check all out for the planet
way more work than I truly want to tackle for this
lord knows its enough already
I guess so but I don’t see a real simple way for it. I was at this point before also one time and that’s why I know that exactly. It feels like …t but there was for me no other way and I believe also for you that would be the simplest way. Yes, it is a lot of work. But also it will be a solution.