Is it possible to have a backup font?

Just starting out? Need help? Post your questions and find answers here.
Joubarbe
Enthusiast
Enthusiast
Posts: 710
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Is it possible to have a backup font?

Post by Joubarbe »

So I have a font A that I really like for standard characters. But then I need some extra unusual glyphs that I have with font B. Is it possible like in CSS to specify / register two fonts, then when the system cannot find a specific glyph in font A, it searches font B?

Pretty sure the answer is no, but who knows :D
AZJIO
Addict
Addict
Posts: 2183
Joined: Sun May 14, 2017 1:48 am

Re: Is it possible to have a backup font?

Post by AZJIO »

Joubarbe
Enthusiast
Enthusiast
Posts: 710
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: Is it possible to have a backup font?

Post by Joubarbe »

AZJIO wrote: Sun Aug 24, 2025 11:26 am viewtopic.php?t=81756
Thank you for your reply, but it's a different problem. Your problem is "if the system doesn't find my font", my problem is "if the system doesn't find the glyph". In my scenario, both fonts are registered and really exist in the system.

(and I realise that's CSS does exactly that; it fixes your problem, but not mine - probably hard to detect if a glyph exists or not?)
User avatar
jacdelad
Addict
Addict
Posts: 2004
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Is it possible to have a backup font?

Post by jacdelad »

I think you have to do this yourself: define your string somehow and render it into a custom gadget, like a canvas.
On the other hand: create your own font that fits your needs.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
minimy
Enthusiast
Enthusiast
Posts: 613
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Is it possible to have a backup font?

Post by minimy »

May be using a character list and a procedure to verify if the glyph exist or not?.
if result="" then glyph not exist or maybe another character when is empty depend of the font. (some times are filled with arbitrary character, inspect your font)

If result=""
font= glyphFont
Else
font= textFont
Endif

Is only an idea. Idk if we are speaking about same thing... (because is sunday, im in the beach and i have a box of beers) :lol:
If translation=Error: reply="Sorry, Im Spanish": Endif
Joubarbe
Enthusiast
Enthusiast
Posts: 710
Joined: Wed Sep 18, 2013 11:54 am
Location: France

Re: Is it possible to have a backup font?

Post by Joubarbe »

Invalid characters do not return "", but a generic square. What I will end up doing is to take the glygh number (with 'glyph') and check that instead.
Axolotl
Addict
Addict
Posts: 832
Joined: Wed Dec 31, 2008 3:36 pm

Re: Is it possible to have a backup font?

Post by Axolotl »

I guess you have to do that by yourself.
For example windows always tries to find a character set, and that probably also applies to individual characters.
But that's far too specific for me to go into in any more detail...
See for yourself on M$ help pages or in the similar documentation of the OS you use, ...
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Post Reply