コード例 #1
0
ファイル: TextRender.cs プロジェクト: Mokarski/Vagonka
        private Adjustments LoadGlyph(uint index)
        {
            Adjustments adjustments;

            mEscapements.TryGetValue(index, out adjustments);
            if (adjustments != null)
            {
                return(adjustments);
            }

            //Application.GetInstance().DebugTimeToConsole("--> LoadGlyph (" + index + "):");
            {
                Glyph rv;
                mGlyphDictionary.TryGetValue(index, out rv);

                if (rv == null)
                {
                    return(null);
                }

                adjustments = new Adjustments(rv.escapement[0], rv.escapement[1]);
                mEscapements.Add(rv.glyphIndex, adjustments);

                var glyphPath = VG.vgCreatePath(0, VGPathDatatype.VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VGPathCapabilities.VG_PATH_CAPABILITY_ALL);
                VG.vgAppendPathData(glyphPath, rv.commands.Length, rv.commands, rv.coordinates);
                VG.vgSetGlyphToPath(mFont, rv.glyphIndex, glyphPath, VGboolean.VG_TRUE, rv.origin, rv.escapement);
                VG.vgDestroyPath(glyphPath);
            }

            return(adjustments);
            //Application.GetInstance().DebugTimeToConsole("<-- LoadGlyph (" + index + "):");
        }