How do you handle fonts in a unicode software?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

How do you handle fonts in a unicode software?

Post by kaisellgren »

Hello,

I'm writing a software that has, surprisingly, a front-end and a back-end. Both should be multilingual. I have no problems dealing with PHP directly, but I'm not sure what to do with fonts. For example, my back-end has a neat interface, which uses Nina -font via @font-face. My project is demanding in many areas, so, no replies like "@font-face is not widely implemented" here please. Anyway, the question is that if I allow the admin to change the back-end language to, say, Korean, what font would I be using? What if he chooses Chinese, or Arabic?

I'm not sure how to test fonts or how to decide which fonts to use. Should I implement a system where the font changes depending on the language? Or should I try to find a font that supports as many languages (glyphs) as possible? And what about the front-end?

I can do things like modifying CSS, or even download fonts online and set @font-faces accordingly. So, all suggestions you got are welcome here (as weird as they might sound).

It's easy for basic Latin, just use any font that looks good on the interface and you are ready to go.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: How do you handle fonts in a unicode software?

Post by alex.barylski »

I don't have an answer for you but this is a great question...something I've wondered myself...
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: How do you handle fonts in a unicode software?

Post by josh »

If the character set cannot be implemented with the chosen font, I guess the browser (according to css spec) would fall back to the next defined fonts, wether you define several separated by comma or it will fall back to the browser's default which is probably the users OS default (the correct locale). So the worst thing you could do is wind up displaying a page in a font you didn't choose

The is all semi-based on assumption though.
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: How do you handle fonts in a unicode software?

Post by kaisellgren »

I did some research.

I'm gonna implement a system where the language pack contains a font/fonts for the language. The reason is because some languages use different versions for the same code points. For example, Chinese Traditional and Chinese Simplified have different symbols for the same Unicode code points, which means one font can either support Traditional or Simplified Chinese. Having custom fonts for each language also allows people to use different styles. Now that we have @font-face, people want to use custom fonts for headings, etc. I found out that there are plenty of Chinese people who like to use @font-face to load custom Chinese fonts on their Chinese site. Custom fonts will always look better and more appropriate for the specific situation, because no single font can fit all designs.

Also, since I'm not gonna translate my software to Chinese, Japanese and many other languages, I don't need to worry about which fonts to choose. I'm sure the translators know at least one font to use.

Btw, as I have seen it, web browsers will always render Unicode properly, but if you don't specify any fonts containing the needed symbols/characters, the result may not look so beautiful.
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: How do you handle fonts in a unicode software?

Post by kaisellgren »

http://en.wikipedia.org/wiki/Han_unific ... characters

Wikipedia has a good example of what I was trying to explain earlier. The same code point is used for the same grapheme, which looks different across languages. For that matter, I need to use language specific fonts.

Now, I'm getting the hang of this. I hope someone else finds this useful, as well. :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: How do you handle fonts in a unicode software?

Post by josh »

I don't that matters, the differences between those characters equate to the differences between a serif and sans serif font, a person speaking that language should be able to read them all about the same.
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: How do you handle fonts in a unicode software?

Post by kaisellgren »

I thought that too, then I personally talked with a few people and one of them showed me this

Image
He told me that using a wrong font will look like an alien just like the above sevens look to us. Most of the letters look pretty much the same across languages, but there are a few letters that look like aliens.

Take a look at U+7D00 in Korean and Chinese simplified, they look a lot different.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: How do you handle fonts in a unicode software?

Post by josh »

Gotchya, gotta go with the native language speaker rather then what some guy wrote on wikipedia :oops:
Post Reply