freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Freetype] Japanese text


From: Mark Storer
Subject: RE: [Freetype] Japanese text
Date: Tue, 28 May 2002 09:44:39 -0700

Setting a cmap is fairly simply...

if(FT_Select_Charmap(face, ft_encoding_unicode) == 0)
{
        // it worked
}

All the valid encodings are listed in freetype.h, and all start with
'ft_encoding'.

I end up storing my multi-byte text as a string of bytes anyway, so using FT
wasn't a big stretch for me.  So long as you get the 'endian-ness' right,
you should be just fine.


--Mark Storer
  Software Engineer
  Cardiff Software

#include <disclaimer>
typedef std::disclaimer<Cardiff> Discard;


-----Original Message-----
From: Chris Forno [mailto:address@hidden
Sent: Saturday, May 25, 2002 5:59 PM
To: address@hidden
Subject: [Freetype] Japanese text


Perhaps this is not the right place to be asking this, but I've been
searching for an answer for days, so...

How exactly can I go about setting up freetype to render Japanese characters
(or characters from non-English languages, for that matter).  I have no
problem rendering English text with C++/FreeType/SDL, but I'm unsure of how
to approach Japanese text.

I'm able to load the font without problems, but I'm unsure of how to get
C++/FreeType to recognize a string as Japanese text.  So far I'm only typing
the text into my source file (which is getting saved in the EUC encoding)
and prefixing it with L (which I guess makes it a wide string).  Then I use
a basic_string<wchar_t> and an iterator to pass characters to FreeType.  The
problem is that instead of taking a 16-bit character and looking it up, it
takes 2 8-bit characters.

I know that I'm way off here and I really don't have a clue of how to do
this correctly.  I've tried a combination of converting my source file to
jis/sjis and setting the encoding to unicode and sjis with
FT_Select_Charmap.  I haven't been able to figure out how to use
FT_Set_Charmap yet since I don't know how to get a Charmap to send to it!

Anyway, I know this is a mess, but I would really appreciate any pointers to
any information that can help me figure out how to do this.

By the way, I do not speak (much) Japanese and have very little experience
with Japanese information processing outside of using a Japanese IRC client.

Thanks in advance for any help that you can provide.

_______________________________________________
Freetype mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/freetype



reply via email to

[Prev in Thread] Current Thread [Next in Thread]