Note that there are some explanatory texts on larger screens.

plurals
  1. POStop WPF using Century in place of Century Gothic
    text
    copied!<p>Our design prefers to use Century Gothic if it's installed, but falls back to Arial or Lucidia if it's not available. This works fine for the most part, unless the machine doesn't have Century Gothic installed, but <em>does</em> have Century (which appears to be a lot of XP machines without Office). "Helpfully" it substitutes Century, which is horrible and serif-ey, for Century Gothic, and completely ignores our fallback fonts.</p> <p>It's easily reproducible by having a machine with Century and not Century Gothic, then create a TextBlock such as:</p> <pre><code>&lt;TextBlock FontFamily="Century Gothic, Wingdings"&gt;Should be gibberish&lt;/TextBlock&gt; </code></pre> <p>It <em>should</em> show as gibberish Wingdings, but instead it shows in ugly but readable Century.</p> <p>I've tried wrapping Century Gothic up in a compositefont, but that has the same issue:</p> <pre><code>&lt;FontFamily xmlns="http://schemas.microsoft.com/winfx/2006/xaml/composite-font" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib"&gt; &lt;FontFamily.FamilyNames&gt; &lt;System:String x:Key="en-US"&gt;CenturyGothic&lt;/System:String&gt; &lt;/FontFamily.FamilyNames&gt; &lt;FontFamily.FamilyTypefaces&gt; &lt;FamilyTypeface Weight="Normal" Stretch="Normal" Style="Normal" /&gt; &lt;FamilyTypeface Weight="Bold" Stretch="Normal" Style="Normal" /&gt; &lt;/FontFamily.FamilyTypefaces&gt; &lt;FontFamily.FamilyMaps&gt; &lt;FontFamilyMap Target="Century Gothic" Scale="1" /&gt; &lt;/FontFamily.FamilyMaps&gt; &lt;/FontFamily&gt; </code></pre> <p>Embedding the font isn't an option (licensing) - is there any way to force it to ignore Century, or am I resigned to changing it to use a different font?</p> <p><strong>Edit:</strong> I've just tried using FontFace="'Century Gothic',Wingdings" but that never displays Century Gothic, even if it's installed.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload