void createFont()
 {
     if (currentFontFace == nullptr)
     {
         WindowsDirectWriteTypeface* typeface = dynamic_cast<WindowsDirectWriteTypeface*> (font.getTypeface());
         currentFontFace = typeface->getIDWriteFontFace();
         fontHeightToEmSizeFactor = typeface->unitsToHeightScaleFactor();
     }
 }
void Direct2DLowLevelGraphicsContext::SavedState::createFont()
{
    if (currentFontFace == 0)
    {
        WindowsDirectWriteTypeface* typeface = dynamic_cast<WindowsDirectWriteTypeface*> (font.getTypeface());
        currentFontFace = typeface->getIDWriteFontFace();
        fontHeightToEmSizeFactor = typeface->getFontHeightToEmSizeFactor();
    }
}