Japanese characters

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
mastastealth
Prole
Posts: 30
Joined: Thu Jul 03, 2008 2:44 am
Location: Barranquilla, Colombia
Contact:

Japanese characters

Post by mastastealth »

Hey, how would I go about having Lua print out Japanese (or any other weird foreign letter)? Inserting the character directly doesn't work, so is there some sort of hex/decimal code or something I gotta insert instead?
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Japanese characters

Post by qubodup »

Worthless reply by someone who doesn't really know, but just googled it.

http://lua-users.org/wiki/LuaUnicode

Don't worry, someone else is bound to give a more verbose and more useful reply
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
cag
Citizen
Posts: 65
Joined: Sun Jun 29, 2008 5:09 am

Re: Japanese characters

Post by cag »

No, you can't print Japanese just by inserting unicode, as the output functions are designed to work with western 8-bit chars only, I believe.
However, you can print Japanese by making an image font and mapping certain characters to certain letters.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Japanese characters

Post by rude »

Imagine if all kanji had to be rasterized and sent to the GPU when loading a truetype font. I think that would take a while. ^^
User avatar
mastastealth
Prole
Posts: 30
Joined: Thu Jul 03, 2008 2:44 am
Location: Barranquilla, Colombia
Contact:

Re: Japanese characters

Post by mastastealth »

Hmm. Ok, guess I got no other choice. Then I'd just like to throw out there that support for SVG would be nice. I was trying to avoid using images since I wanted the letters to scale nicely. :D
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Japanese characters

Post by rude »

I've always wanted SVG support, but I do not know of any acceptable OpenGL rasterizer.

Also, note that even if the truetype fonts had support for Japanese characters, they would still not scale perfectly, since the fonts are rasterized when loaded, not in real time (that would be slow).
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Japanese characters

Post by qubodup »

lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
Sardtok
Party member
Posts: 108
Joined: Thu Feb 21, 2008 2:37 pm
Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
Contact:

Re: Japanese characters

Post by Sardtok »

I wonder how it would rasterise Chinese characters though,
as in the system, usually they don't make one glyph for every font.
They make glyphs for radicals, and then radicals are put together into one font.
Like:
糸 - thread - 士 - warrior, man (it's a picture of an erect penis) - 口 - mouth, entrance/exit - are standalone glyphs, and also used as radicals for hanzi like: 結 - to tie (which is built of those exact three simple hanzi).

If it was possible to make a raster of radicals sensibly, then there wouldn't be a need for rasterising huge amounts of glyphs, but then again, there are at least 213 radicals, some of which have to be rendered several times depending on placement, plus stand-alone characters and for Japanese there's also kana, which is 96, plus kana with 点々(dots) and circles for the ones on H, then there's the small ones, should bring you up to somewhere around 128 or more, then half-width katakana, if you are to support it, and lots of special characters that make no sense and are only used in Japanese smilies.

So, yes, it makes more sense to make bitmaps of the characters you actually need and just use those.
Take off every Zigg for great rapist.
Now, outgay that!
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: Japanese characters

Post by Skofo »

rude wrote:Also, note that even if the truetype fonts had support for Japanese characters, they would still not scale perfectly, since the fonts are rasterized when loaded, not in real time (that would be slow).
How do web browsers do it?
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Japanese characters

Post by bartbes »

You did notice this in the last post?
Post by Sardtok on 21 Jul 2008, 13:54
I don't have an answer to your question, but I don't think there are any browser devs here.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], shugarcat and 227 guests