Esempio n. 1
0
        public static FaceInfo GetFaceInfo()
        {
            FaceInfo result = default(FaceInfo);

            FontEngine.GetFaceInfo_Internal(ref result);
            return(result);
        }
Esempio n. 2
0
        internal static GlyphPairAdjustmentRecord GetGlyphPairAdjustmentRecord(uint firstGlyphIndex, uint secondGlyphIndex)
        {
            GlyphPairAdjustmentRecord result;

            FontEngine.GetGlyphPairAdjustmentRecord_Injected(firstGlyphIndex, secondGlyphIndex, out result);
            return(result);
        }
Esempio n. 3
0
        internal static bool TryAddGlyphToTexture(uint glyphIndex, int padding, GlyphPackingMode packingMode, List <GlyphRect> freeGlyphRects, List <GlyphRect> usedGlyphRects, GlyphRenderMode renderMode, Texture2D texture, out Glyph glyph)
        {
            int  count  = freeGlyphRects.Count;
            int  count2 = usedGlyphRects.Count;
            int  num    = count + count2;
            bool flag   = FontEngine.s_FreeGlyphRects.Length < num || FontEngine.s_UsedGlyphRects.Length < num;

            if (flag)
            {
                int num2 = Mathf.NextPowerOfTwo(num + 1);
                FontEngine.s_FreeGlyphRects = new GlyphRect[num2];
                FontEngine.s_UsedGlyphRects = new GlyphRect[num2];
            }
            int num3 = Mathf.Max(count, count2);

            for (int i = 0; i < num3; i++)
            {
                bool flag2 = i < count;
                if (flag2)
                {
                    FontEngine.s_FreeGlyphRects[i] = freeGlyphRects[i];
                }
                bool flag3 = i < count2;
                if (flag3)
                {
                    FontEngine.s_UsedGlyphRects[i] = usedGlyphRects[i];
                }
            }
            GlyphMarshallingStruct glyphStruct;
            bool flag4 = FontEngine.TryAddGlyphToTexture_Internal(glyphIndex, padding, packingMode, FontEngine.s_FreeGlyphRects, ref count, FontEngine.s_UsedGlyphRects, ref count2, renderMode, texture, out glyphStruct);
            bool result;

            if (flag4)
            {
                glyph = new Glyph(glyphStruct);
                freeGlyphRects.Clear();
                usedGlyphRects.Clear();
                num3 = Mathf.Max(count, count2);
                for (int j = 0; j < num3; j++)
                {
                    bool flag5 = j < count;
                    if (flag5)
                    {
                        freeGlyphRects.Add(FontEngine.s_FreeGlyphRects[j]);
                    }
                    bool flag6 = j < count2;
                    if (flag6)
                    {
                        usedGlyphRects.Add(FontEngine.s_UsedGlyphRects[j]);
                    }
                }
                result = true;
            }
            else
            {
                glyph  = null;
                result = false;
            }
            return(result);
        }
Esempio n. 4
0
        internal static bool TryPackGlyphInAtlas(Glyph glyph, int padding, GlyphPackingMode packingMode, GlyphRenderMode renderMode, int width, int height, List <GlyphRect> freeGlyphRects, List <GlyphRect> usedGlyphRects)
        {
            GlyphMarshallingStruct glyphMarshallingStruct = new GlyphMarshallingStruct(glyph);
            int  count  = freeGlyphRects.Count;
            int  count2 = usedGlyphRects.Count;
            int  num    = count + count2;
            bool flag   = FontEngine.s_FreeGlyphRects.Length < num || FontEngine.s_UsedGlyphRects.Length < num;

            if (flag)
            {
                int num2 = Mathf.NextPowerOfTwo(num + 1);
                FontEngine.s_FreeGlyphRects = new GlyphRect[num2];
                FontEngine.s_UsedGlyphRects = new GlyphRect[num2];
            }
            int num3 = Mathf.Max(count, count2);

            for (int i = 0; i < num3; i++)
            {
                bool flag2 = i < count;
                if (flag2)
                {
                    FontEngine.s_FreeGlyphRects[i] = freeGlyphRects[i];
                }
                bool flag3 = i < count2;
                if (flag3)
                {
                    FontEngine.s_UsedGlyphRects[i] = usedGlyphRects[i];
                }
            }
            bool flag4 = FontEngine.TryPackGlyphInAtlas_Internal(ref glyphMarshallingStruct, padding, packingMode, renderMode, width, height, FontEngine.s_FreeGlyphRects, ref count, FontEngine.s_UsedGlyphRects, ref count2);
            bool result;

            if (flag4)
            {
                glyph.glyphRect = glyphMarshallingStruct.glyphRect;
                freeGlyphRects.Clear();
                usedGlyphRects.Clear();
                num3 = Mathf.Max(count, count2);
                for (int j = 0; j < num3; j++)
                {
                    bool flag5 = j < count;
                    if (flag5)
                    {
                        freeGlyphRects.Add(FontEngine.s_FreeGlyphRects[j]);
                    }
                    bool flag6 = j < count2;
                    if (flag6)
                    {
                        usedGlyphRects.Add(FontEngine.s_UsedGlyphRects[j]);
                    }
                }
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Esempio n. 5
0
        public static FontEngineError LoadFontFace(byte[] sourceFontFile)
        {
            bool            flag = sourceFontFile.Length == 0;
            FontEngineError result;

            if (flag)
            {
                result = FontEngineError.Invalid_File;
            }
            else
            {
                result = (FontEngineError)FontEngine.LoadFontFace_FromSourceFontFile_Internal(sourceFontFile);
            }
            return(result);
        }
Esempio n. 6
0
        internal static FontEngineError RenderGlyphsToSharedTexture(List <Glyph> glyphs, int padding, GlyphRenderMode renderMode)
        {
            int  count = glyphs.Count;
            bool flag  = FontEngine.s_GlyphMarshallingStruct_IN.Length < count;

            if (flag)
            {
                int num = Mathf.NextPowerOfTwo(count + 1);
                FontEngine.s_GlyphMarshallingStruct_IN = new GlyphMarshallingStruct[num];
            }
            for (int i = 0; i < count; i++)
            {
                FontEngine.s_GlyphMarshallingStruct_IN[i] = new GlyphMarshallingStruct(glyphs[i]);
            }
            return((FontEngineError)FontEngine.RenderGlyphsToSharedTexture_Internal(FontEngine.s_GlyphMarshallingStruct_IN, count, padding, renderMode));
        }
Esempio n. 7
0
        public static bool TryGetGlyphWithIndexValue(uint glyphIndex, GlyphLoadFlags flags, out Glyph glyph)
        {
            GlyphMarshallingStruct glyphStruct = default(GlyphMarshallingStruct);
            bool flag = FontEngine.TryGetGlyphWithIndexValue_Internal(glyphIndex, flags, ref glyphStruct);
            bool result;

            if (flag)
            {
                glyph  = new Glyph(glyphStruct);
                result = true;
            }
            else
            {
                glyph  = null;
                result = false;
            }
            return(result);
        }
Esempio n. 8
0
        internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentRecords(uint glyphIndex, out int recordCount)
        {
            FontEngine.PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndex(glyphIndex, out recordCount);
            bool flag = recordCount == 0;

            GlyphPairAdjustmentRecord[] result;
            if (flag)
            {
                result = null;
            }
            else
            {
                FontEngine.SetMarshallingArraySize <GlyphPairAdjustmentRecord>(ref FontEngine.s_PairAdjustmentRecords_MarshallingArray, recordCount);
                FontEngine.GetGlyphPairAdjustmentRecordsFromMarshallingArray(FontEngine.s_PairAdjustmentRecords_MarshallingArray);
                FontEngine.s_PairAdjustmentRecords_MarshallingArray[recordCount] = default(GlyphPairAdjustmentRecord);
                result = FontEngine.s_PairAdjustmentRecords_MarshallingArray;
            }
            return(result);
        }
Esempio n. 9
0
        internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentTable(uint[] glyphIndexes)
        {
            int num;

            FontEngine.PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndexes(glyphIndexes, out num);
            bool flag = num == 0;

            GlyphPairAdjustmentRecord[] result;
            if (flag)
            {
                result = null;
            }
            else
            {
                FontEngine.SetMarshallingArraySize <GlyphPairAdjustmentRecord>(ref FontEngine.s_PairAdjustmentRecords_MarshallingArray, num);
                FontEngine.GetGlyphPairAdjustmentRecordsFromMarshallingArray(FontEngine.s_PairAdjustmentRecords_MarshallingArray);
                FontEngine.s_PairAdjustmentRecords_MarshallingArray[num] = default(GlyphPairAdjustmentRecord);
                result = FontEngine.s_PairAdjustmentRecords_MarshallingArray;
            }
            return(result);
        }
Esempio n. 10
0
        internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentRecords(List <uint> newGlyphIndexes, List <uint> allGlyphIndexes)
        {
            FontEngine.GenericListToMarshallingArray <uint>(ref newGlyphIndexes, ref FontEngine.s_GlyphIndexes_MarshallingArray_A);
            FontEngine.GenericListToMarshallingArray <uint>(ref allGlyphIndexes, ref FontEngine.s_GlyphIndexes_MarshallingArray_B);
            int num;

            FontEngine.PopulatePairAdjustmentRecordMarshallingArray_for_NewlyAddedGlyphIndexes(FontEngine.s_GlyphIndexes_MarshallingArray_A, FontEngine.s_GlyphIndexes_MarshallingArray_B, out num);
            bool flag = num == 0;

            GlyphPairAdjustmentRecord[] result;
            if (flag)
            {
                result = null;
            }
            else
            {
                FontEngine.SetMarshallingArraySize <GlyphPairAdjustmentRecord>(ref FontEngine.s_PairAdjustmentRecords_MarshallingArray, num);
                FontEngine.GetGlyphPairAdjustmentRecordsFromMarshallingArray(FontEngine.s_PairAdjustmentRecords_MarshallingArray);
                FontEngine.s_PairAdjustmentRecords_MarshallingArray[num] = default(GlyphPairAdjustmentRecord);
                result = FontEngine.s_PairAdjustmentRecords_MarshallingArray;
            }
            return(result);
        }
Esempio n. 11
0
 public static FontEngineError SetFaceSize(int pointSize)
 {
     return((FontEngineError)FontEngine.SetFaceSize_Internal(pointSize));
 }
Esempio n. 12
0
 public static FontEngineError LoadFontFace(string filePath)
 {
     return((FontEngineError)FontEngine.LoadFontFace_Internal(filePath));
 }
Esempio n. 13
0
        internal static bool TryAddGlyphsToTexture(List <uint> glyphIndexes, int padding, GlyphPackingMode packingMode, List <GlyphRect> freeGlyphRects, List <GlyphRect> usedGlyphRects, GlyphRenderMode renderMode, Texture2D texture, out Glyph[] glyphs)
        {
            Profiler.BeginSample("FontEngine.TryAddGlyphsToTexture");
            glyphs = null;
            bool flag = glyphIndexes == null || glyphIndexes.Count == 0;
            bool result;

            if (flag)
            {
                Profiler.EndSample();
                result = false;
            }
            else
            {
                int  count = glyphIndexes.Count;
                bool flag2 = FontEngine.s_GlyphIndexes_MarshallingArray_A == null || FontEngine.s_GlyphIndexes_MarshallingArray_A.Length < count;
                if (flag2)
                {
                    bool flag3 = FontEngine.s_GlyphIndexes_MarshallingArray_A == null;
                    if (flag3)
                    {
                        FontEngine.s_GlyphIndexes_MarshallingArray_A = new uint[count];
                    }
                    else
                    {
                        int num = Mathf.NextPowerOfTwo(count + 1);
                        FontEngine.s_GlyphIndexes_MarshallingArray_A = new uint[num];
                    }
                }
                int  count2 = freeGlyphRects.Count;
                int  count3 = usedGlyphRects.Count;
                int  num2   = count2 + count3 + count;
                bool flag4  = FontEngine.s_FreeGlyphRects.Length < num2 || FontEngine.s_UsedGlyphRects.Length < num2;
                if (flag4)
                {
                    int num3 = Mathf.NextPowerOfTwo(num2 + 1);
                    FontEngine.s_FreeGlyphRects = new GlyphRect[num3];
                    FontEngine.s_UsedGlyphRects = new GlyphRect[num3];
                }
                bool flag5 = FontEngine.s_GlyphMarshallingStruct_OUT.Length < count;
                if (flag5)
                {
                    int num4 = Mathf.NextPowerOfTwo(count + 1);
                    FontEngine.s_GlyphMarshallingStruct_OUT = new GlyphMarshallingStruct[num4];
                }
                int num5 = FontEngineUtilities.MaxValue(count2, count3, count);
                for (int i = 0; i < num5; i++)
                {
                    bool flag6 = i < count;
                    if (flag6)
                    {
                        FontEngine.s_GlyphIndexes_MarshallingArray_A[i] = glyphIndexes[i];
                    }
                    bool flag7 = i < count2;
                    if (flag7)
                    {
                        FontEngine.s_FreeGlyphRects[i] = freeGlyphRects[i];
                    }
                    bool flag8 = i < count3;
                    if (flag8)
                    {
                        FontEngine.s_UsedGlyphRects[i] = usedGlyphRects[i];
                    }
                }
                bool flag9  = FontEngine.TryAddGlyphsToTexture_Internal(FontEngine.s_GlyphIndexes_MarshallingArray_A, padding, packingMode, FontEngine.s_FreeGlyphRects, ref count2, FontEngine.s_UsedGlyphRects, ref count3, renderMode, texture, FontEngine.s_GlyphMarshallingStruct_OUT, ref count);
                bool flag10 = FontEngine.s_Glyphs == null || FontEngine.s_Glyphs.Length <= count;
                if (flag10)
                {
                    FontEngine.s_Glyphs = new Glyph[Mathf.NextPowerOfTwo(count + 1)];
                }
                FontEngine.s_Glyphs[count] = null;
                freeGlyphRects.Clear();
                usedGlyphRects.Clear();
                num5 = FontEngineUtilities.MaxValue(count2, count3, count);
                for (int j = 0; j < num5; j++)
                {
                    bool flag11 = j < count;
                    if (flag11)
                    {
                        FontEngine.s_Glyphs[j] = new Glyph(FontEngine.s_GlyphMarshallingStruct_OUT[j]);
                    }
                    bool flag12 = j < count2;
                    if (flag12)
                    {
                        freeGlyphRects.Add(FontEngine.s_FreeGlyphRects[j]);
                    }
                    bool flag13 = j < count3;
                    if (flag13)
                    {
                        usedGlyphRects.Add(FontEngine.s_UsedGlyphRects[j]);
                    }
                }
                glyphs = FontEngine.s_Glyphs;
                Profiler.EndSample();
                result = flag9;
            }
            return(result);
        }
Esempio n. 14
0
 internal static void SendCancellationRequest()
 {
     FontEngine.SendCancellationRequest_Internal();
 }
Esempio n. 15
0
 internal static FontEngineError LoadGlyph(uint unicode, GlyphLoadFlags flags)
 {
     return((FontEngineError)FontEngine.LoadGlyph_Internal(unicode, flags));
 }
Esempio n. 16
0
 public static FontEngineError LoadFontFace(Font font, int pointSize)
 {
     return((FontEngineError)FontEngine.LoadFontFace_With_Size_FromFont_Internal(font, pointSize));
 }
Esempio n. 17
0
 public static FontEngineError InitializeFontEngine()
 {
     return((FontEngineError)FontEngine.InitializeFontEngine_Internal());
 }
Esempio n. 18
0
 private static int RenderGlyphToTexture_Internal(GlyphMarshallingStruct glyphStruct, int padding, GlyphRenderMode renderMode, Texture2D texture)
 {
     return(FontEngine.RenderGlyphToTexture_Internal_Injected(ref glyphStruct, padding, renderMode, texture));
 }
Esempio n. 19
0
        internal static FontEngineError RenderGlyphToTexture(Glyph glyph, int padding, GlyphRenderMode renderMode, Texture2D texture)
        {
            GlyphMarshallingStruct glyphStruct = new GlyphMarshallingStruct(glyph);

            return((FontEngineError)FontEngine.RenderGlyphToTexture_Internal(glyphStruct, padding, renderMode, texture));
        }
Esempio n. 20
0
        internal static bool TryPackGlyphsInAtlas(List <Glyph> glyphsToAdd, List <Glyph> glyphsAdded, int padding, GlyphPackingMode packingMode, GlyphRenderMode renderMode, int width, int height, List <GlyphRect> freeGlyphRects, List <GlyphRect> usedGlyphRects)
        {
            int  count  = glyphsToAdd.Count;
            int  count2 = glyphsAdded.Count;
            int  count3 = freeGlyphRects.Count;
            int  count4 = usedGlyphRects.Count;
            int  num    = count + count2 + count3 + count4;
            bool flag   = FontEngine.s_GlyphMarshallingStruct_IN.Length < num || FontEngine.s_GlyphMarshallingStruct_OUT.Length < num || FontEngine.s_FreeGlyphRects.Length < num || FontEngine.s_UsedGlyphRects.Length < num;

            if (flag)
            {
                int num2 = Mathf.NextPowerOfTwo(num + 1);
                FontEngine.s_GlyphMarshallingStruct_IN  = new GlyphMarshallingStruct[num2];
                FontEngine.s_GlyphMarshallingStruct_OUT = new GlyphMarshallingStruct[num2];
                FontEngine.s_FreeGlyphRects             = new GlyphRect[num2];
                FontEngine.s_UsedGlyphRects             = new GlyphRect[num2];
            }
            FontEngine.s_GlyphLookupDictionary.Clear();
            for (int i = 0; i < num; i++)
            {
                bool flag2 = i < count;
                if (flag2)
                {
                    GlyphMarshallingStruct glyphMarshallingStruct = new GlyphMarshallingStruct(glyphsToAdd[i]);
                    FontEngine.s_GlyphMarshallingStruct_IN[i] = glyphMarshallingStruct;
                    bool flag3 = !FontEngine.s_GlyphLookupDictionary.ContainsKey(glyphMarshallingStruct.index);
                    if (flag3)
                    {
                        FontEngine.s_GlyphLookupDictionary.Add(glyphMarshallingStruct.index, glyphsToAdd[i]);
                    }
                }
                bool flag4 = i < count2;
                if (flag4)
                {
                    GlyphMarshallingStruct glyphMarshallingStruct2 = new GlyphMarshallingStruct(glyphsAdded[i]);
                    FontEngine.s_GlyphMarshallingStruct_OUT[i] = glyphMarshallingStruct2;
                    bool flag5 = !FontEngine.s_GlyphLookupDictionary.ContainsKey(glyphMarshallingStruct2.index);
                    if (flag5)
                    {
                        FontEngine.s_GlyphLookupDictionary.Add(glyphMarshallingStruct2.index, glyphsAdded[i]);
                    }
                }
                bool flag6 = i < count3;
                if (flag6)
                {
                    FontEngine.s_FreeGlyphRects[i] = freeGlyphRects[i];
                }
                bool flag7 = i < count4;
                if (flag7)
                {
                    FontEngine.s_UsedGlyphRects[i] = usedGlyphRects[i];
                }
            }
            bool result = FontEngine.TryPackGlyphsInAtlas_Internal(FontEngine.s_GlyphMarshallingStruct_IN, ref count, FontEngine.s_GlyphMarshallingStruct_OUT, ref count2, padding, packingMode, renderMode, width, height, FontEngine.s_FreeGlyphRects, ref count3, FontEngine.s_UsedGlyphRects, ref count4);

            glyphsToAdd.Clear();
            glyphsAdded.Clear();
            freeGlyphRects.Clear();
            usedGlyphRects.Clear();
            for (int j = 0; j < num; j++)
            {
                bool flag8 = j < count;
                if (flag8)
                {
                    GlyphMarshallingStruct glyphMarshallingStruct3 = FontEngine.s_GlyphMarshallingStruct_IN[j];
                    Glyph glyph = FontEngine.s_GlyphLookupDictionary[glyphMarshallingStruct3.index];
                    glyph.metrics    = glyphMarshallingStruct3.metrics;
                    glyph.glyphRect  = glyphMarshallingStruct3.glyphRect;
                    glyph.scale      = glyphMarshallingStruct3.scale;
                    glyph.atlasIndex = glyphMarshallingStruct3.atlasIndex;
                    glyphsToAdd.Add(glyph);
                }
                bool flag9 = j < count2;
                if (flag9)
                {
                    GlyphMarshallingStruct glyphMarshallingStruct4 = FontEngine.s_GlyphMarshallingStruct_OUT[j];
                    Glyph glyph2 = FontEngine.s_GlyphLookupDictionary[glyphMarshallingStruct4.index];
                    glyph2.metrics    = glyphMarshallingStruct4.metrics;
                    glyph2.glyphRect  = glyphMarshallingStruct4.glyphRect;
                    glyph2.scale      = glyphMarshallingStruct4.scale;
                    glyph2.atlasIndex = glyphMarshallingStruct4.atlasIndex;
                    glyphsAdded.Add(glyph2);
                }
                bool flag10 = j < count3;
                if (flag10)
                {
                    freeGlyphRects.Add(FontEngine.s_FreeGlyphRects[j]);
                }
                bool flag11 = j < count4;
                if (flag11)
                {
                    usedGlyphRects.Add(FontEngine.s_UsedGlyphRects[j]);
                }
            }
            return(result);
        }
Esempio n. 21
0
 public static FontEngineError LoadFontFace(string filePath, int pointSize)
 {
     return((FontEngineError)FontEngine.LoadFontFace_With_Size_Internal(filePath, pointSize));
 }
Esempio n. 22
0
        internal static bool TryAddGlyphsToTexture(List <Glyph> glyphsToAdd, List <Glyph> glyphsAdded, int padding, GlyphPackingMode packingMode, List <GlyphRect> freeGlyphRects, List <GlyphRect> usedGlyphRects, GlyphRenderMode renderMode, Texture2D texture)
        {
            Profiler.BeginSample("FontEngine.TryAddGlyphsToTexture");
            int  count = glyphsToAdd.Count;
            int  num   = 0;
            bool flag  = FontEngine.s_GlyphMarshallingStruct_IN.Length < count || FontEngine.s_GlyphMarshallingStruct_OUT.Length < count;

            if (flag)
            {
                int  newSize = Mathf.NextPowerOfTwo(count + 1);
                bool flag2   = FontEngine.s_GlyphMarshallingStruct_IN.Length < count;
                if (flag2)
                {
                    Array.Resize <GlyphMarshallingStruct>(ref FontEngine.s_GlyphMarshallingStruct_IN, newSize);
                }
                bool flag3 = FontEngine.s_GlyphMarshallingStruct_OUT.Length < count;
                if (flag3)
                {
                    Array.Resize <GlyphMarshallingStruct>(ref FontEngine.s_GlyphMarshallingStruct_OUT, newSize);
                }
            }
            int  count2 = freeGlyphRects.Count;
            int  count3 = usedGlyphRects.Count;
            int  num2   = count2 + count3 + count;
            bool flag4  = FontEngine.s_FreeGlyphRects.Length < num2 || FontEngine.s_UsedGlyphRects.Length < num2;

            if (flag4)
            {
                int  newSize2 = Mathf.NextPowerOfTwo(num2 + 1);
                bool flag5    = FontEngine.s_FreeGlyphRects.Length < num2;
                if (flag5)
                {
                    Array.Resize <GlyphRect>(ref FontEngine.s_FreeGlyphRects, newSize2);
                }
                bool flag6 = FontEngine.s_UsedGlyphRects.Length < num2;
                if (flag6)
                {
                    Array.Resize <GlyphRect>(ref FontEngine.s_UsedGlyphRects, newSize2);
                }
            }
            FontEngine.s_GlyphLookupDictionary.Clear();
            int  num3  = 0;
            bool flag7 = true;

            while (flag7)
            {
                flag7 = false;
                bool flag8 = num3 < count;
                if (flag8)
                {
                    Glyph glyph = glyphsToAdd[num3];
                    FontEngine.s_GlyphMarshallingStruct_IN[num3] = new GlyphMarshallingStruct(glyph);
                    FontEngine.s_GlyphLookupDictionary.Add(glyph.index, glyph);
                    flag7 = true;
                }
                bool flag9 = num3 < count2;
                if (flag9)
                {
                    FontEngine.s_FreeGlyphRects[num3] = freeGlyphRects[num3];
                    flag7 = true;
                }
                bool flag10 = num3 < count3;
                if (flag10)
                {
                    FontEngine.s_UsedGlyphRects[num3] = usedGlyphRects[num3];
                    flag7 = true;
                }
                num3++;
            }
            bool result = FontEngine.TryAddGlyphsToTexture_Internal_MultiThread(FontEngine.s_GlyphMarshallingStruct_IN, ref count, FontEngine.s_GlyphMarshallingStruct_OUT, ref num, padding, packingMode, FontEngine.s_FreeGlyphRects, ref count2, FontEngine.s_UsedGlyphRects, ref count3, renderMode, texture);

            glyphsToAdd.Clear();
            glyphsAdded.Clear();
            freeGlyphRects.Clear();
            usedGlyphRects.Clear();
            num3  = 0;
            flag7 = true;
            while (flag7)
            {
                flag7 = false;
                bool flag11 = num3 < count;
                if (flag11)
                {
                    uint index = FontEngine.s_GlyphMarshallingStruct_IN[num3].index;
                    glyphsToAdd.Add(FontEngine.s_GlyphLookupDictionary[index]);
                    flag7 = true;
                }
                bool flag12 = num3 < num;
                if (flag12)
                {
                    uint  index2 = FontEngine.s_GlyphMarshallingStruct_OUT[num3].index;
                    Glyph glyph2 = FontEngine.s_GlyphLookupDictionary[index2];
                    glyph2.atlasIndex = FontEngine.s_GlyphMarshallingStruct_OUT[num3].atlasIndex;
                    glyph2.scale      = FontEngine.s_GlyphMarshallingStruct_OUT[num3].scale;
                    glyph2.glyphRect  = FontEngine.s_GlyphMarshallingStruct_OUT[num3].glyphRect;
                    glyph2.metrics    = FontEngine.s_GlyphMarshallingStruct_OUT[num3].metrics;
                    glyphsAdded.Add(glyph2);
                    flag7 = true;
                }
                bool flag13 = num3 < count2;
                if (flag13)
                {
                    freeGlyphRects.Add(FontEngine.s_FreeGlyphRects[num3]);
                    flag7 = true;
                }
                bool flag14 = num3 < count3;
                if (flag14)
                {
                    usedGlyphRects.Add(FontEngine.s_UsedGlyphRects[num3]);
                    flag7 = true;
                }
                num3++;
            }
            Profiler.EndSample();
            return(result);
        }
Esempio n. 23
0
 public static FontEngineError LoadFontFace(Font font)
 {
     return((FontEngineError)FontEngine.LoadFontFace_FromFont_Internal(font));
 }
Esempio n. 24
0
 public static FontEngineError DestroyFontEngine()
 {
     return((FontEngineError)FontEngine.DestroyFontEngine_Internal());
 }