Ejemplo n.º 1
0
        public void createDefaultTags(BlockAlignment blockAlignment)
        {
            // UTF-16LE string containing font name
            byte[] fontname = { 22,                0, // 11 chars
                                (byte)'I',         0, (byte)'W',         0, (byte)'A',         0, 0x0E,      0x66, (byte)'-', 0, 0x2D, 0x4E, 0x30,
                                0x7D,      (byte)'N',         0, (byte)'-',         0, (byte)'e',    0, (byte)'b', 0 };

            Tags.Add(new UInt16Tag(TagId.RubyOverhang, 0x0000));
            Tags.Add(new UInt16Tag(TagId.EmpLinePosition, 0x0001));
            Tags.Add(new UInt16Tag(TagId.EmpLineMode, 0x0000));
            Tags.Add(new UInt16Tag(TagId.EmpDotsPosition, 0x0001));
            Tags.Add(new UInt16Tag(TagId.FontSize, 100));
            Tags.Add(new UInt16Tag(TagId.FontWidth, 0xfff6));
            Tags.Add(new UInt16Tag(TagId.FontEscapement, 0x0000));
            Tags.Add(new UInt16Tag(TagId.FontOrientation, 0x0000));
            Tags.Add(new UInt16Tag(TagId.FontWeight, 400));
            Tags.Add(new ByteArrayTag(TagId.FontFacename, fontname));
            Tags.Add(new UInt32Tag(TagId.TextColor, 0));
            Tags.Add(new UInt32Tag(TagId.TextBgColor, 0x00ff));
            Tags.Add(new UInt16Tag(TagId.WordSpace, 0x0019));
            Tags.Add(new UInt16Tag(TagId.LetterSpace, 0x0000));
            Tags.Add(new UInt16Tag(TagId.BaseLineSkip, 0x008c));
            Tags.Add(new UInt16Tag(TagId.LineSpace, 0x000a));
            Tags.Add(new UInt16Tag(TagId.ParIndent, 0));
            Tags.Add(new UInt16Tag(TagId.ParSkip, 0));
            Tags.Add(new UInt16Tag(TagId.LineWidth, 0x0002));
            Tags.Add(new UInt32Tag(TagId.LineColor, 0));
            Tags.Add(new UInt16Tag(TagId.BlockAlignment, (ushort)blockAlignment));
            Tags.Add(new UInt16Tag(TagId.FontUnknownTwo, 0x0001));
            Tags.Add(new UInt16Tag(TagId.FontUnknownThree, 0x0000));
            Tags.Add(new UInt16Tag(TagId.RubyAlign, 0x0001));
        }
Ejemplo n.º 2
0
        public TextBuilder ApplyBlockMode(int width, int lines, int lineSpace, BlockAlignment alignment)
        {
            Context.BlockMode      = true;
            Context.BlockWidth     = width;
            Context.BlockLines     = lines;
            Context.BlockLineSpace = lineSpace;
            Context.BlockAlignment = alignment;

            return(this);
        }
Ejemplo n.º 3
0
    public static string GetPrefabPath(BlockPlaceholder block)
    {
        string         text      = string.Empty;
        BlockAlignment alignment = block.Alignment;

        if (alignment == BlockAlignment.Top || alignment == BlockAlignment.Middle || alignment == BlockAlignment.Bottom)
        {
            text = "_" + block.Alignment;
        }
        return("Blocks/" + block.Type.ToString() + "Cube_" + block.Width + "x" + block.Height + text);
    }
Ejemplo n.º 4
0
    public static string GetPrefabPath(BlockType block, int blockSize, BlockAlignment blockAlignment)
    {
        string text = string.Empty;

        switch (block)
        {
        case BlockType.Grass:
        case BlockType.Dirt:
        case BlockType.Stone:
        case BlockType.Gold:
            text = "_" + blockAlignment;
            break;
        }
        return("Blocks/" + block.ToString() + "Cube_" + blockSize + "x" + blockSize + text);
    }
Ejemplo n.º 5
0
 public static ZPLCommand FB(int width, int lines, int spaceBetweenLines, BlockAlignment align)
 => new ZPLCommand("^FB", width, lines, spaceBetweenLines, (char)align);
Ejemplo n.º 6
0
 public TextBuilder ApplyBlockMode(int width, BlockAlignment alignment)
 => ApplyBlockMode(width, ZPLForgeDefaults.Elements.Text.BlockLines, alignment);
Ejemplo n.º 7
0
 public bool ShouldSerializeBlockAlignment() =>
 SerializeDefaults ||
 !BlockAlignment.Equals(ZPLForgeDefaults.Elements.Text.BlockAlignment);