private void CreateSharedResources() { // create text format object for various test modes m_generalTextFormat = D2dFactory.CreateTextFormat("Calibri" , D2dFontWeight.Bold, D2dFontStyle.Normal, D2dFactory.FontSizeToPixel(16)); m_generalTextFormat.WordWrapping = D2dWordWrapping.Wrap; }
private void UpdateToTheme() { D2dTextFormat textFormat = m_theme.TextFormat; if (m_centerText == null || textFormat.FontFamilyName != m_centerText.FontFamilyName || textFormat.FontSize != m_centerText.FontSize) { if (m_centerText != null) { m_centerText.Dispose(); } m_centerText = D2dFactory.CreateTextFormat(textFormat.FontFamilyName, D2dFontWeight.Bold, D2dFontStyle.Normal, m_theme.TextFormat.FontHeight); m_centerText.TextAlignment = D2dTextAlignment.Center; m_centerText.ParagraphAlignment = D2dParagraphAlignment.Center; m_fontHeight = m_theme.TextFormat.FontHeight; } }