Update VLWCompress\readme.md

This commit is contained in:
Lucy2003 2021-07-16 07:31:49 +00:00 committed by GitHub
parent 9393f05fdc
commit 90812ea857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 26 deletions

View File

@ -3,6 +3,7 @@
Used to transform 8bit VLW file into 4bit VLW file with no padding support. Used to transform 8bit VLW file into 4bit VLW file with no padding support.
**Advantage**: It will save at least 50% space. **Advantage**: It will save at least 50% space.
**Limitation**: Fonts that height over 255 are not being generated properly. **Limitation**: Fonts that height over 255 are not being generated properly.
To Compile,run the command below: To Compile,run the command below:
@ -13,7 +14,9 @@ To Compile,run the command below:
#### Compressed Font format #### Compressed Font format
Header of vlw file is the same as uncompressed;it comprises 6 uint32_t parameters (24 bytes total): Header of vlw file is the same as uncompressed;it comprises 6 uint32_t parameters (24 bytes total):
1. The gCount (number of character glyphs) 1. The gCount (number of character glyphs)
2. A version number (0xB = 11 for uncompressed,0XC = 12 for compressed 4bit) 2. A version number (0xB = 11 for uncompressed,0XC = 12 for compressed 4bit)
3. The font size (in points, not pixels) 3. The font size (in points, not pixels)
@ -22,6 +25,7 @@ Header of vlw file is the same as uncompressed;it comprises 6 uint32_t parameter
6. Descent in pixels from baseline to bottom of "p" 6. Descent in pixels from baseline to bottom of "p"
Next are gCount sets of values for each glyph(8 bytes): Next are gCount sets of values for each glyph(8 bytes):
1. (16 bits) Glyph Unicode 1. (16 bits) Glyph Unicode
2. (8 bits) Height of bitmap bounding box 2. (8 bits) Height of bitmap bounding box
3. (8 bits) Width of bitmap bounding box 3. (8 bits) Width of bitmap bounding box
@ -33,11 +37,12 @@ Header of vlw file is the same as uncompressed;it comprises 6 uint32_t parameter
Each pixel is 0.5 byte, an 4 bit Alpha value which represents the transparency from Each pixel is 0.5 byte, an 4 bit Alpha value which represents the transparency from
0xF foreground colour, 0x0 background.When a line consist of odd number of pixels,the last byte 0xF foreground colour, 0x0 background.When a line consist of odd number of pixels,the last byte
for the last pixel of the line will be filled with 0 as low 4 bits. for the last pixel of the line will be filled with 0 as low 4 bits.
4 bits alpha value will be generated to 8 bits before drawing. 4 bits alpha value will be converted to 8 bits before drawing.
After the bitmaps is (Not modified): After the bitmaps is (Not modified):
1 byte for font name string length (excludes null)
a zero terminated character string giving the font name - 1 byte for font name string length (excludes null)
1 byte for Postscript name string length - a zero terminated character string giving the font name
a zero/one terminated character string giving the font name - 1 byte for Postscript name string length
last byte is 0 for non-anti-aliased and 1 for anti-aliased (smoothed) - a zero/one terminated character string giving the font name
- last byte is 0 for non-anti-aliased and 1 for anti-aliased (smoothed)