Kuldip Krori
Kuldip Krori

Reputation: 65

How to mention a specific font as default for a particular unicode value in windows?

I am making a win32 application using c++. When using the default font, the system takes care of displaying non English symbols, such as characters in Hindi. However, for some special symbols, such as the Indian Rupee symbol (₹), it only displays a square (which I think indicates that the current symbol cannot be displayed). I have installed the Rupakara font, which is capable of displaying the symbol.
I wanted to know is there any way by which I can mention that if the symbol is from the currency Range, I wish to use the Rupakara font, else the default system font. Thus, the appearance will be that whatever the user types, he gets the correct symbol for the same. I know I can individually check the values are within that range, but I want to have an API call that will set it to use this font for this range, as I can use this later for setting other fonts for different ranges as well.
Please let me know if any further details are required, or is there some other way to do the same without explicitly checking each character which range it belongs to and setting the font for the same.
Thanks

Upvotes: 3

Views: 410

Answers (1)

Yakov Galka
Yakov Galka

Reputation: 72469

Microsoft Windows does not substitute fonts.

Your options are:

  1. Edit the font you currently use and merge this character there (e.g. using FontForge). Make sure the licenses of the fonts in question permit you doing this.
  2. Use a text rendering engine that does font substitution. It means that you won't be able to use the built-in Windows functionality though, like default text boxes and text rendering functions.

Upvotes: 1

Related Questions