Solved

How to determine if font is unicode?

Posted on 2002-06-05
2
685 Views
Last Modified: 2013-12-02
In my Unicode application I allow the user to change font between an ordinary 8-bit font and Unicode fonts such as Chinese.

How do I determine whether the current font (CFont or LOGFONT) is a Unicode font, i.e., a font that requires 16-bit to store in a file?

Is there a method that can be called on a CFont to determine that it cannot be represented in 8 bits?
0
Comment
Question by:Claus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7055752
find "HOWTO: Translate Unicode Character Codes to TrueType Glyph Indices in Windows 95" in MSDN.

MSDN says

All Microsoft Unicode encodings (Platform ID = 3, Encoding ID = 1) must use Format 4 for their 'cmap' subtable. Microsoft strongly recommends using a Unicode 'cmap' for all fonts. However, some other encodings that appear in current fonts follow:
Platform ID      Encoding ID      Description
3           0           Symbol
3           1           Unicode
3           2            ShiftJIS      
3           3            Big5
3           4            PRC
3           5            Wansung
3           6            Johab


GOOD LUCK
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 7056275
What about using

GetFontUnicodeRanges

The GetFontUnicodeRanges function returns information about which Unicode characters are supported by a font. The information is returned as a GLYPHSET structure.

WINGDIAPI DWORD WINAPI GetFontUnicodeRanges(
  HDC hdc,         // handle to the device context
  LPGLYPHSET lpgs  // pointer to the glyph set structure
);
 
Parameters
hdc
Handle to the device context.
lpgs
Pointer to a buffer to contain the GLYPHSET structure. If this parameter is NULL, the function returns a pointer to the GLYPHSET structure for the current font.
Return Values
If the function succeeds, it returns a pointer to the font's GLYPHSET structure for the current device context.

If the function fails, it returns zero.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question