public static byte[] CreateUserDefinedCharacter(bool set)
        {
            IDisplayCommandBuilder builder = StarIoExt.CreateDisplayCommandBuilder(DisplayModel.SCD222);

            builder.AppendClearScreen();
            builder.AppendCursorMode(DisplayCursorMode.Off);
            builder.AppendHomePosition();

            builder.AppendInternational(DisplayInternationalType.USA);
            builder.AppendCodePage(DisplayCodePageType.Japanese);

            if (set)
            {
                byte[] font =
                {
                    0x00, 0x00, 0x32, 0x00, 0x49, 0x00, 0x49, 0x7f, 0x26, 0x48, 0x00, 0x48, 0x00, 0x30, 0x00, 0x00
                };

                byte[] dbcsFont =
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0x04, 0x90, 0x04, 0x90, 0x02, 0x60,
                    0x00, 0x00, 0x07, 0xf0, 0x04, 0x80, 0x04, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                };

                builder.AppendUserDefinedCharacter(0, 0x20, font);
                builder.AppendUserDefinedDbcsCharacter(0, 0x8140, dbcsFont);
            }
            else
            {
                builder.AppendUserDefinedCharacter(0, 0x20, null);
                builder.AppendUserDefinedDbcsCharacter(0, 0x8140, null);
            }

            byte[] textPattern =
            {
                0x5b, 0x20, 0x20, 0x53, 0x74, 0x61, 0x72, 0x20, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x6e, 0x69, 0x63, 0x73, 0x20, 0x20, 0x5d,
                0x5b, 0x81, 0x40, 0x81, 0x40, 0x83, 0x58, 0x83, 0x5e, 0x81, 0x5b, 0x90, 0xb8, 0x96, 0xa7, 0x81, 0x40, 0x81, 0x40, 0x5d,
            };

            builder.Append(textPattern);

            return(builder.PassThroughCommands);
        }
        public static byte[] CreateCharacterSet(DisplayInternationalType internationalType, DisplayCodePageType codePageType)
        {
            IDisplayCommandBuilder builder = StarIoExt.CreateDisplayCommandBuilder(DisplayModel.SCD222);

            builder.AppendClearScreen();
            builder.AppendCursorMode(DisplayCursorMode.Off);
            builder.AppendHomePosition();

            builder.AppendInternational(internationalType);
            builder.AppendCodePage(codePageType);

            byte[] pattern1 =
            {
                0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d,
                0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3
            };

            byte[] pattern2 =
            {
                0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d,
                0x88, 0xa0, 0x88, 0xa1, 0x88, 0xa2, 0x88, 0xa3, 0x88, 0xa4, 0x88, 0xa5, 0x88, 0xa6, 0x88, 0xa7, 0x88, 0xa8, 0x88, 0xa9
            };

            byte[] pattern3 =
            {
                0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d,
                0xb0, 0xa1, 0xb0, 0xa2, 0xb0, 0xa3, 0xb0, 0xa4, 0xb0, 0xa5, 0xb0, 0xa6, 0xb0, 0xa7, 0xb0, 0xa8, 0xb0, 0xa9, 0xb0, 0xaa
            };

            byte[] pattern4 =
            {
                0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d,
                0xa4, 0x40, 0xa4, 0x41, 0xa4, 0x42, 0xa4, 0x43, 0xa4, 0x44, 0xa4, 0x45, 0xa4, 0x46, 0xa4, 0x47, 0xa4, 0x48, 0xa4, 0x49
            };

            byte[] pattern5 =
            {
                0x2d, 0x20, 0x20, 0x20, 0x23, 0x24, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x20, 0x20, 0x2d,
                0xb0, 0xa1, 0xb0, 0xa2, 0xb0, 0xa3, 0xb0, 0xa4, 0xb0, 0xa5, 0xb0, 0xa6, 0xb0, 0xa7, 0xb0, 0xa8, 0xb0, 0xa9, 0xb0, 0xaa
            };

            byte[] textPattern;

            switch (codePageType)
            {
            default:     // CP437,Katakana,CP850,CP860,CP863,CP865,CP1252,CP866,CP852,CP858
                textPattern = pattern1;
                break;

            case DisplayCodePageType.Japanese:
                textPattern = pattern2;
                break;

            case DisplayCodePageType.SimplifiedChinese:
                textPattern = pattern3;
                break;

            case DisplayCodePageType.TraditionalChinese:
                textPattern = pattern4;
                break;

            case DisplayCodePageType.Hangul:
                textPattern = pattern5;
                break;
            }

            builder.Append(textPattern);

            return(builder.PassThroughCommands);
        }