Wednesday, August 22, 2012

Render English and Chinese with mono font

(This is an unresolved issue)

How to make a Chinese character exactly 2 English characters wide?

I've tried it in WPF application with Courier New and Segoe UI Mono, but both failed. And also tried SimSun as fallback font, failed again.

Here is the summary of my test.
Successful Examples
Notepad
Notepad++
HTML with pre tag rendered by Chrome

Failed Examples
Visual Studio 2010
HTML without pre tag rendered by Chrome
HTML with and without pre tag rendered by IE

I tried Courier New and Segoe UI Mono with fallback font SimSun in my WPF app. The fallback font mechanism worked, because it can render STLiti which is 隶书, see below


One Chinese char is a little bit less than 2 English chars in width. when fallback font is SimSun, it's the same case
Figure 1

Visual Studio has the same issue
Figure 2

While Notepad++ is pretty successful
Figure 3

Different web browser has different behavior. With
<pre> tag would work well in Chrome while it can't give you Chinese char of 2 English chars width without
<pre>. And IE can't do it in both cases.



As you can see Chinese chars in Figure 3 is a little bit wider than Chinese chars in Figure 1. Is there a covered mechanism results narrow Chinese chars?

1 comment:

Anonymous said...

Discover a bit about Buzz Lightyear. You could genuinely impress your pals by hitting your appropriate shoulder (red button) and saying 'To infinity, and beyond!', in Toy Story this button releases the wings. You could also hit your left must (blue) and say 'Star command', somehow this button links Buzz to star command, do not ask me how could even carry a laser.
Typical instructional [url=http://www.vbboots.co.uk/]Ugg Boots cheap[/url]
classes have the ideas of colors, routine making, by utilizing software program package design, style historical previous, supplies, typical sewing and tailoring. Even though in this bill sort, retaining funds in it and monetary transaction utilizing it price nothing, it characteristics a placed manage for [url=http://www.dalinsell.co.uk/]Ugg Boots sale[/url]
benefiting from expenses in the thirty day period. offers you an wonderful high good quality with a blend of development and design.
One more potential Net supply forUgg boots sale cheap ugg boots are the different auction-type word wide internet web sites. Enter the kind and color you desire and your size into the search engine to see if any individual has a pair becoming auctioned off. Of course, if you get a pair, and the value around the beginning bid is right, that does not mean the boots are yours.
The name "Ugg Boots" refers to a particular style of boot that is created from genuine sheepskin. The boots had been initially created in Australia. Today, an American firm owns the Ugg trademark ("Ugg Australia"), but they are nevertheless made from the exact same Australian Merino sheepskin, only in Australia they are sold as "Australian Sheepskin Boots.".
The girls will fully appreciate the entertainment and joy in their daily life. The black sweater added a sub-cool taste to the girls who wear it, they will be a bit neutral. The colorful scarves and cap revealed uninhibited taste as effectively as unrestrained casual feeling.