示例#1
0
        //Load a glyphics file, precompute rectangles and append them to codeString as speedy cache
        public static void PreSerializeGlyphicsFile(string filename)
        {
            CodeList codes = GlyToCodes(filename);

            foreach (Code t in codes)
            {
                string code = t.codeString;

                if (code.Contains("*"))
                {
                    code = code.Split('*')[0];
                }

                Grid grid = CodeConverter.TokensToGrid(CodeConverter.CodeToTokens(new Code(code)));

                if (grid != null)
                {
                    RectList rectSet         = GridConverter.GridToRects(grid);
                    string   serializedRects = RectConverter.RectsToSerializedRects(rectSet).SerializedData;
                    code         = code + serializedRects;
                    t.codeString = code;
                }
            }
            CodesToGly(filename, codes);
        }
示例#2
0
 //Rect(s)-To
 public static Code RectsToCode(RectList rectSet)
 {
     if (rectSet == null)
     {
         return(null);
     }
     return(RectConverter.RectsToCode(rectSet));
 }
示例#3
0
 //public static RectList SerializedRectsToRects(string serializedRects) { return RectConverter.SerializedRectsToRects(new SerializedRects(serializedRects)); }
 public static SerializedRects RectsToSerializedRectsLimit255(RectList rectSet)
 {
     return(new SerializedRects(RectConverter.SerializeLimit255(rectSet)));
 }
示例#4
0
 public static RectList SerializedRectsToRects(SerializedRects serializedRects)
 {
     return(RectConverter.SerializedRectsToRects(serializedRects));
 }
示例#5
0
 public static SerializedRects RectsToSerializedRects(RectList rectSet)
 {
     return(RectConverter.RectsToSerializedRects(rectSet));
 }
示例#6
0
 public static RectList CodeToRects(Code rasterCode)
 {
     return(RectConverter.CodeToRects(rasterCode));
 }
示例#7
0
 public static int RemoveRedundantQuads(QuadList quads)
 {
     return(RectConverter.RemoveRedundantQuads(quads));
 }
示例#8
0
 //Quad and QuadList
 public static QuadList RectsToQuads(RectList rectSet)
 {
     return(RectConverter.RectsToQuads(rectSet));
 }