コード例 #1
0
ファイル: StyleProperties.cs プロジェクト: dsisco11/CssUI
        public void Resolve_Font()
        {
            if (0 == (StyleFlags & EPropertySystemDirtFlags.NeedsToResolveFont))
            {
                return;
            }

            if (!(FontSize == oldFontSize))
            {
                oldFontSize = FontSize;
                Notify_Unit_Scale_Change(ECssUnit.EM);
                Notify_Unit_Scale_Change(ECssUnit.EX);
                Notify_Unit_Scale_Change(ECssUnit.CH);
            }

#if DISABLE_FONT_SYSTEM
#else
            // Get font from font factory, which will help cache identical fonts
            FontOptions fontOptions = new FontOptions(FontFamily, FontSize, FontWeight, FontStyle);
            Font = FontFactory.Get(fontOptions);

            // XXX: Find the new equivalent of the below code once the new rendering system is finished
            // Flag our elements font dirty flag so it updates whatever is using it
            //this.Flag(EElementDirtyFlags.Font);
#endif

            // Remove font dirt flag
            ClearFlag(EPropertySystemDirtFlags.NeedsToResolveFont);
        }