public TypefaceListItem(Typeface typeface) { _displayName = GetDisplayName(typeface); _simulated = typeface.IsBoldSimulated || typeface.IsObliqueSimulated; this.FontFamily = typeface.FontFamily; this.FontWeight = typeface.Weight; this.FontStyle = typeface.Style; this.FontStretch = typeface.Stretch; string itemLabel = _displayName; if (_simulated) { string formatString = RimeControl.Properties.Resources.ResourceManager.GetString( "simulated", CultureInfo.CurrentUICulture ); itemLabel = string.Format(formatString, itemLabel); } this.Text = itemLabel; this.ToolTip = itemLabel; // In the case of symbol font, apply the default message font to the text so it can be read. if (FontFamilyListItem.IsSymbolFont(typeface.FontFamily)) { TextRange range = new TextRange(this.ContentStart, this.ContentEnd); range.ApplyPropertyValue(TextBlock.FontFamilyProperty, SystemFonts.MessageFontFamily); } }
public TypefaceListItem(Typeface typeface) { _displayName = GetDisplayName(typeface); _simulated = typeface.IsBoldSimulated || typeface.IsObliqueSimulated; this.FontFamily = typeface.FontFamily; this.FontWeight = typeface.Weight; this.FontStyle = typeface.Style; this.FontStretch = typeface.Stretch; string itemLabel = _displayName; if (_simulated) { //itemLabel += "*"; } this.Text = itemLabel; this.ToolTip = itemLabel; // In the case of symbol font, apply the default message font to the text so it can be read. if (FontFamilyListItem.IsSymbolFont(typeface.FontFamily)) { TextRange range = new TextRange(this.ContentStart, this.ContentEnd); range.ApplyPropertyValue(TextBlock.FontFamilyProperty, SystemFonts.MessageFontFamily); } }