Ejemplo n.º 1
0
        static FontAsset GetFontAsset(Font font)
        {
            FontAsset fontAsset = null;

            if (fontAssetCache.TryGetValue(font, out fontAsset) && fontAsset != null)
            {
                return(fontAsset);
            }
            fontAsset = FontAsset.CreateFontAsset(font, 90, 9, GlyphRenderMode.SDFAA, 1024, 1024,
                                                  AtlasPopulationMode.Dynamic);
            return(fontAssetCache[font] = fontAsset);
        }
Ejemplo n.º 2
0
        private static FontAsset GetFontAsset(Font font)
        {
            FontAsset fontAsset = null;
            bool      flag      = TextHandle.fontAssetCache.TryGetValue(font, out fontAsset) && fontAsset != null;
            FontAsset result;

            if (flag)
            {
                result = fontAsset;
            }
            else
            {
                fontAsset = FontAsset.CreateFontAsset(font, 90, 9, GlyphRenderMode.SDFAA, 1024, 1024, FontAsset.AtlasPopulationMode.Dynamic);
                result    = (TextHandle.fontAssetCache[font] = fontAsset);
            }
            return(result);
        }