font naming issue

D

David Thielen

Hi;

We have a weird one here. An rtf file where the font has it's name in
Chinese characters. Not the alternate name - the main name. When we
save as WordML or DOCX same thing - it's 2 Chinese characters.

But when we open it in Word, including the Chinese version of word, it
says "Sim Sum". Is this an internal translation? And how should we
handle this to know what font to use?

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jie Wang [MSFT]

Hi David,

I believe you're talking about the font family named "SimSun" - correct me
if I was wrong.

This post contains the two Chinese characters you mentioned. You'll need to
install Asian Languages Support on the system to have them displayed
correctly.

"SimSun" and "ËÎÌå" are just the same thing. You're seeing different names
because of different regional settings in Control Panel.

In Control Panel -> Regional and Language Options dialog, there is an
option for "Language for non-Unicode programs". When this option is set to
"Chinese (PRC)", the font family will be displayed as "ËÎÌå", when this
option is set to other languages that doesn't have appropriate character
set to display the name (like English), it uses "SimSun".

You may check this setting on the system which you have the Chinese version
of Word installed to verify this behavior.

Talking about programming in .NET, we can simply set the
Thread.CurrentUICulture to get corresponding Chinese/English names for the
same font:

FontFamily ff;

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");
ff = new FontFamily("SimSun");
Console.WriteLine(ff.Name);

Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-cn");
ff = new FontFamily("SimSun");
Console.WriteLine(ff.Name);

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");
ff = new FontFamily("ËÎÌå");
Console.WriteLine(ff.Name);

Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-cn");
ff = new FontFamily("ËÎÌå");
Console.WriteLine(ff.Name);

The output of the above code will be:
SimSun
ËÎÌå
SimSun
ËÎÌå

That means when programming, you can always use "SimSun" as the name (so
you don't need to learn how to type Chinese), and set the correct
CurrentUICulture to show the localized user friendly name at runtime.

Hope this helps. If you have any further questions regarding this issue,
please feel free to post here.

Regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jie Wang [MSFT]

Okay... it looks like my default News Group application is not Unicode
friendly... The two Chinese characters are not correctly sent. But it
doesn't affect the ideas anyway.

Let me try it with UTF-8 encoding in another new group app: 宋体
 
D

David Thielen

Hi;

I understand all of that. What I don't understand is I thought the
name in rtf/WordML was supposed to be in english and the altname was
the chinese. Isn't that what the alt name is for?


Hi David,

I believe you're talking about the font family named "SimSun" - correct me
if I was wrong.

This post contains the two Chinese characters you mentioned. You'll need to
install Asian Languages Support on the system to have them displayed
correctly.

"SimSun" and "ËÎÌå" are just the same thing. You're seeing different names
because of different regional settings in Control Panel.

In Control Panel -> Regional and Language Options dialog, there is an
option for "Language for non-Unicode programs". When this option is set to
"Chinese (PRC)", the font family will be displayed as "ËÎÌå", when this
option is set to other languages that doesn't have appropriate character
set to display the name (like English), it uses "SimSun".

You may check this setting on the system which you have the Chinese version
of Word installed to verify this behavior.

Talking about programming in .NET, we can simply set the
Thread.CurrentUICulture to get corresponding Chinese/English names for the
same font:

FontFamily ff;

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");
ff = new FontFamily("SimSun");
Console.WriteLine(ff.Name);

Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-cn");
ff = new FontFamily("SimSun");
Console.WriteLine(ff.Name);

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");
ff = new FontFamily("ËÎÌå");
Console.WriteLine(ff.Name);

Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-cn");
ff = new FontFamily("ËÎÌå");
Console.WriteLine(ff.Name);

The output of the above code will be:
SimSun
ËÎÌå
SimSun
ËÎÌå

That means when programming, you can always use "SimSun" as the name (so
you don't need to learn how to type Chinese), and set the correct
CurrentUICulture to show the localized user friendly name at runtime.

Hope this helps. If you have any further questions regarding this issue,
please feel free to post here.

Regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jie Wang [MSFT]

Hi David,
I understand all of that. What I don't understand is I thought the
name in rtf/WordML was supposed to be in english and the altname was
the chinese.

The name needn't to be in English. The font file has a table which contains
a list of names corresponding to different language / platform / encoding.
In our case, it means "SimSun" == "ËÎÌå", these two names are on the same
level and none of them is the alternative name for the other. So either
name can be used.

Whether the English name or the Chinese name is used depends on the OS
environment (default code page for non-Unicode applications) and the
application logic.

The specification for the font naming table is here:
http://www.microsoft.com/typography/otspec/name.htm
Isn't that what the alt name is for?

No.

The alt name is to define other font(s) to be used when the primary font
cannot be located on the machine.

For example, I can define SimSun as the primary font for a paragraph, and
then define one or more alt names: Arial, Verdana, Times New Roman.
When the document is opened on a machine where the font SimSun doesn't
exist, the application shall look for Arial to be used as an alternative;
if Arial doesn't exist either, then Verdana...

So if I define the primary font name as SimSun and alt name as "ËÎÌå", that
won't make much sense because I am using the same font for both primary and
alternative.

This behavior in WordML is defined in ECMA-376, Second Edition, Part 1,
Section 17.8.3.1 altName (Alternate Names for Font).
http://www.ecma-international.org/publications/standards/Ecma-376.htm

Regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Found the issue - in RTF it writes the name using the RTF codepage -
but we had a case where a chinese doc was imported into a US doc and
codepage 1252 can't write Chinese.

thanks - dave


Okay... it looks like my default News Group application is not Unicode
friendly... The two Chinese characters are not correctly sent. But it
doesn't affect the ideas anyway.

Let me try it with UTF-8 encoding in another new group app: ??


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
D

David Thielen

got it - thanks - dave


Hi David,


The name needn't to be in English. The font file has a table which contains
a list of names corresponding to different language / platform / encoding.
In our case, it means "SimSun" == "ËÎÌå", these two names are on the same
level and none of them is the alternative name for the other. So either
name can be used.

Whether the English name or the Chinese name is used depends on the OS
environment (default code page for non-Unicode applications) and the
application logic.

The specification for the font naming table is here:
http://www.microsoft.com/typography/otspec/name.htm


No.

The alt name is to define other font(s) to be used when the primary font
cannot be located on the machine.

For example, I can define SimSun as the primary font for a paragraph, and
then define one or more alt names: Arial, Verdana, Times New Roman.
When the document is opened on a machine where the font SimSun doesn't
exist, the application shall look for Arial to be used as an alternative;
if Arial doesn't exist either, then Verdana...

So if I define the primary font name as SimSun and alt name as "ËÎÌå", that
won't make much sense because I am using the same font for both primary and
alternative.

This behavior in WordML is defined in ECMA-376, Second Edition, Part 1,
Section 17.8.3.1 altName (Alternate Names for Font).
http://www.ecma-international.org/publications/standards/Ecma-376.htm

Regards,

Jie Wang ([email protected], remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top