Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to determine if font is unicode?

Posted on 2002-06-05
2
Medium Priority
?
691 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 300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

661 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