Giter Site home page Giter Site logo

m193's Introduction

M193 Fonts

M193 is a font format that uses opcodes to describe which is which.

The Opcodes

0x5a   Point         int16 x,y;
0x3f   Line          int16 x1,y1,x2,y2;
0x7c   Oval          int16 x1,y1,x2,y2;
0x7e   Circle        int16 cx,cy; int8 radius;
0xfc   Arc           int16 cx,cy,startAngle,sweepAngle; int8 radius;
0xfe   Oval Arc      int16 x1,y1,x2,y2,startAngle,sweepAngle;
0xfd   Rect.         int16 x1,y1,x2,y2;

The Header

Offset  Size  Description
=========================
0       5     Always "M193F".
5       4     Amount of 9 byte structures.

Followed by a contiguous array of this 9 byte structure:

Offset  Size  Description
=========================
0       4     UTF-32 character.
4       4     Pointer to the opcode list.
8       1     Size in bytes of the opcode list.

Integers

An "integer" is no ordinary integer.

Offset  Size  Description
=========================
0       1     A descriptor:
                  Bit    Description
                  ==================
                  0      1 for a math integer, otherwise 0. If 0, next 2 bits must be 0.
                  1      1 if this uses height, otherwise 0.
                  2      1 if this uses width, otherwise 0.
                  3-7    Unused. Always 0.
1       VAR   Amount of the following structure. Or if bit D0 of descriptor is 0, this is the integer.

Offset  Size  Description
=========================
0       1     Math opcode and integer size.
1       VAR   Integer.

Height and width number reservations

If only the height bit is set, the highest integer is for height.
If only the width bit is set, the highest integer is for width.
If the height and width bits are set, the highest integer is for height and the second-highest for width.

Math Opcodes

Opcode   Description
====================
0x0      Used only at the beginning.
0x1      Add.
0x2      Subtract.
0x3      Multiply.
0xe      Divide.
0xf      Modulo.

Integer Sizes

Size    Bits in integer
0       8
1       16
2       32

Math Opcode and Integer Size Structures

These are generated by (mathOpcode << 4) | integerSize.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.