Exemplo n.º 1
0
 internal MatchingStyle(
     FontStyle style,
     FontWeight weight,
     FontStretch stretch
     )
 {
     _vector = new Vector(
         (stretch.ToOpenTypeStretch() - FontStretches.Normal.ToOpenTypeStretch()) * FontStretchScale,
         style.GetStyleForInternalConstruction() * FontStyleScale,
         (weight.ToOpenTypeWeight() - FontWeights.Normal.ToOpenTypeWeight()) / 100.0 * FontWeightScale
         );
 }
Exemplo n.º 2
0
 internal GlyphTypeface GetGlyphTypeface(
     FontStyle style,
     FontWeight weight,
     FontStretch stretch
     )
 {
     Text.TextInterface.Font bestMatch = _family.GetFirstMatchingFont((Text.TextInterface.FontWeight)weight.ToOpenTypeWeight(),
                                                                      (Text.TextInterface.FontStretch)stretch.ToOpenTypeStretch(),
                                                                      (Text.TextInterface.FontStyle)style.GetStyleForInternalConstruction());
     Debug.Assert(bestMatch != null);
     return(new GlyphTypeface(bestMatch));
 }