Example #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);
        }
Example #2
0
 //Rect(s)-To
 public static Code RectsToCode(RectList rectSet)
 {
     if (rectSet == null)
     {
         return(null);
     }
     return(RectConverter.RectsToCode(rectSet));
 }
Example #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)));
 }
Example #4
0
 public static RectList SerializedRectsToRects(SerializedRects serializedRects)
 {
     return(RectConverter.SerializedRectsToRects(serializedRects));
 }
Example #5
0
 public static SerializedRects RectsToSerializedRects(RectList rectSet)
 {
     return(RectConverter.RectsToSerializedRects(rectSet));
 }
Example #6
0
 public static RectList CodeToRects(Code rasterCode)
 {
     return(RectConverter.CodeToRects(rasterCode));
 }
Example #7
0
 public static int RemoveRedundantQuads(QuadList quads)
 {
     return(RectConverter.RemoveRedundantQuads(quads));
 }
Example #8
0
 //Quad and QuadList
 public static QuadList RectsToQuads(RectList rectSet)
 {
     return(RectConverter.RectsToQuads(rectSet));
 }