Unable to set bold font in Chinese language

  • I am implementing application which support chinese & english localization.

        NSFont *stringFont = [NSFont boldSystemFontOfSize:12];
        NSDictionary *stringAttributes = [NSDictionary
    dictionaryWithObject:stringFont forKey:NSFontAttributeName];
        NSAttributedString *tmpattrstring;
        NSString *tmpstring = [[NSString alloc ]init];
        tmpstring = [tmpstring stringByAppendingString:@"  "];
        tmpstring = [tmpstring
    stringByAppendingString:NSLocalizedString(@"DemoText", nil)];
        tmpstring = [tmpstring stringByAppendingString:@"\n\n"];
        tmpattrstring = [[NSAttributedString alloc]
                                    initWithString:majorString
                                        attributes:stringAttributes];

    Now in english, it displays "Demo Text" in bold but in Chinese it does not.
    What is wrong here?

    Please reply.

    Thanks,
    Palav

    --

    There are many things in your life that will catch your eye but only a few
    will catch your heart....pursue those'.
  • On Dec 4, 2007, at 7:23 AM, parag vibhute wrote:

    > I am implementing application which support chinese & english
    > localization.
    >
    > Now in english, it displays "Demo Text" in bold but in Chinese it
    > does not.
    > What is wrong here?

    Do you have bold versions of your Chinese fonts installed?

    Glenn Andreas                      <gandreas...>
      <http://www.gandreas.com/> wicked fun!
    quadrium | flame : flame fractals & strange attractors : build,
    mutate, evolve, animate
  • On Dec 4, 2007, at 5:23 AM, parag vibhute wrote:

    > I am implementing application which support chinese & english
    > localization.
    >
    > NSFont *stringFont = [NSFont boldSystemFontOfSize:12];
    > NSDictionary *stringAttributes = [NSDictionary
    > dictionaryWithObject:stringFont forKey:NSFontAttributeName];
    > NSAttributedString *tmpattrstring;
    > NSString *tmpstring = [[NSString alloc ]init];
    > tmpstring = [tmpstring stringByAppendingString:@"  "];
    > tmpstring = [tmpstring
    > stringByAppendingString:NSLocalizedString(@"DemoText", nil)];
    > tmpstring = [tmpstring stringByAppendingString:@"\n\n"];
    > tmpattrstring = [[NSAttributedString alloc]
    > initWithString:majorString
    > attributes:stringAttributes];
    >
    > Now in english, it displays "Demo Text" in bold but in Chinese it
    > does not.
    > What is wrong here?

    One fundamental problem is the assumption that "bold" is a universal
    concept.  The use of bold and italic variants is a practice of
    European typesetting traditions, and in general it is not directly
    transferrable to East Asian text.  Some fonts do come in multiple
    weights, and for those fonts "bold" will usually end up selecting a
    heavier weight, but most of the Chinese-language fonts shipped with
    Mac OS X supply only a single weight.  Consult your Chinese localizers
    about finding a locale-appropriate substitute for whatever it is that
    you are using "bold" to signify in Latin text.  If you are in fact
    displaying Latin text in your Chinese localization, and really do
    intend to present it as bold, you will need to choose some non-Chinese-
    language font for it.

    Douglas Davidson
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today