Пример #1
0
 internal FontGlyph ReloadGlyphFromChar(char unicodeChar, int pixelSize)
 {
     if (currentFacePixelSize != pixelSize)
     {
         currentFacePixelSize = pixelSize;
         NativeMyFontsLib.MyFtSetPixelSizes(this.ftFaceHandle, pixelSize);
     }
     //--------------------------------------------------
     unsafe
     {
         ExportGlyph exportTypeFace = new ExportGlyph();
         NativeMyFontsLib.MyFtLoadChar(ftFaceHandle, unicodeChar, ref exportTypeFace);
         FontGlyph fontGlyph = new FontGlyph();
         BuildGlyph(fontGlyph, &exportTypeFace, pixelSize);
         return(fontGlyph);
     }
 }
Пример #2
0
        internal Font GetFontAtPixelSize(int pixelSize)
        {
            Font found;

            if (!fonts.TryGetValue(pixelSize, out found))
            {
                //----------------------------------
                //set current fontface size
                currentFacePixelSize = pixelSize;
                NativeMyFontsLib.MyFtSetPixelSizes(this.ftFaceHandle, pixelSize);
                //create font size
                NativeFont f = new NativeFont(this, pixelSize);
                fonts.Add(pixelSize, f);
                //------------------------------------
                return(f);
            }
            return(found);
        }