title: Carbon/Cocoa fonts look different
body: <p>I'm trying to draw in the currently selected system font using the ATSU api in a Carbon app. And the fonts are coming out bolder than all the other native apps. Here is a screenshot example of what I'm talking about:</p>
  <p><a href="https://i.stack.imgur.com/wy9Gj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wy9Gj.png" alt="" /></a><br />
  <sub>(source: <a href="http://memecode.com/images/blog/carbon-fonts.png" rel="nofollow noreferrer">memecode.com</a>)</sub></p>
  <p>The top line is XCode, and the middle is my app using a non-bold font and the bottom is my app using a bold font. I used the same text to make it easy to see the difference in weight between them. The code I'm using to create the styles I draw with is:</p>
  <pre><code>if (Face() AND !(e = ATSUCreateStyle(&amp;d-&gt;hFont)))
  {
      // Lookup ID
      ATSUFontID atsuFont = 0;
      e = ATSUFindFontFromName(Face(),
                              strlen(Face()),
                              kFontFamilyName,
                              (FontPlatformCode)kFontNoPlatform,
                              (FontScriptCode)kFontNoScript,
                              (FontLanguageCode)kFontNoLanguage,
                              &amp;atsuFont);
      if (!e)
      {
          Fixed Size;
          Size = PointSize() &lt;&lt; 16;
          Boolean IsBold = Bold();
          Boolean IsItalic = Italic();
          Boolean IsUnder = Underline();
          
          // Set style attr
          ATSUAttributeTag Tags[]         = {kATSUFontTag,     kATSUSizeTag, kATSUQDItalicTag, kATSUQDUnderlineTag, kATSUQDBoldfaceTag};
          ATSUAttributeValuePtr Values[]  = {&amp;atsuFont,        &amp;Size,        &amp;IsItalic,        &amp;IsUnder,            &amp;IsBold};
          ByteCount Lengths[]             = {sizeof(atsuFont), sizeof(Size), sizeof(IsItalic), sizeof(IsUnder),     sizeof(IsBold)};
          if (!(e = ATSUSetAttributes(d-&gt;hFont,
                                      CountOf(Tags),
                                      Tags,
                                      Lengths,
                                      Values)))
          {
              GDisplayString ds(this, &quot;A&quot;);
              d-&gt;Height = ds.Y();
              return true;
          }
      }
  }
  </code></pre>
  <p>Where &quot;Face()&quot; returns a C string containing the font name, &quot;PointSize()&quot; returns an integer containing the point size I want etc etc. I'm retreiving this values with this code:</p>
  <pre><code>Str255 Name;
  SInt16 Size;
  Style St;
  OSStatus e = GetThemeFont(  kThemeSmallSystemFont,
                              smSystemScript,
                              Name,
                              &amp;Size,
                              &amp;St);
  if (e) printf(&quot;%s:%i - GetThemeFont failed with %i\n&quot;, __FILE__, __LINE__, e);
  else
  {
      Info.Face(p2c(Name));
      Info.PointSize(Size);
      Status = true;
  }
  </code></pre>
  <p>And it returns valid looking face/pointsize info, and in fact the font looks correct apart from it looking bolder than other apps. It might not look like a big difference but when your entire app is full of text it gets to be obvious. And my flagship product is an email client... hence lots of text.</p>
  <p>The drawing code that creates the layouts and eventually calls ATSUDrawText is quite long, and I'm not sure it's causing the issue.. I think it's more style related... but if need by I'll post a link to that source later.</p>
  <p>Can anyone help getting my fonts looking less bold?</p>