Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
5d07bf02
Commit
5d07bf02
authored
18 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add notes on TheDraw .TDF font format.
parent
c1cad148
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/syncdraw/TDF_FORMAT
+75
-0
75 additions, 0 deletions
src/syncdraw/TDF_FORMAT
with
75 additions
and
0 deletions
src/syncdraw/TDF_FORMAT
0 → 100644
+
75
−
0
View file @
5d07bf02
<dig dig dig>
It does use pascal strings...
struct TDHeader {
/* Pascal string [23] - TheDraw Font signature */
/* There may be unknown data after this string instead of a 23 char string */
unsigned char sig_len;
char sig[23];
/* Pascal string [16] - Font name */
unsigned char name_len;
char name[16];
unsigned char font_type; /* 0=outline,
* 1=Block (mono)
* 2=Block(colour)
*/
unsigned char font_spaces; /* Spaces between each letter */
unsigned short font_data_len; /* Total bytes in the font data... file
* size is font_data_len+233
*/
unsigned short chartable[94]; /* Offsets to character start from end of
* header ie:
* fseek(file, chartable[x]+233, SEEK_SET);
*/
};
So basically:
string[23]
string[16]
byte
byte
word
word[94]
Is the header... which is 233 bytes long.
sizeof(struct TDHeader)==233;
Now on to the font data...
index into the chartable array is asc(char)-asc("!") ie: ! is the first char.
The char data starts at file offset 233+chartable[char].
At that position are two bytes, the X and Y extents in that order for that char.
Following that is a series of font data **rows** each row is terminated by an
ASCII 10 (\x0a). The character data is terminated by an ASCII NULL (\x00)
This is true for all three font types. The meaning of each char however varies
as follows:
0) Outline fonts:
Each char *MUST* be between 'A' and 'Q'. Any other char is translated as an
empty space.
A: Horiz. Line #1
B: Horiz. Line #2
C: Vertical Line #1
D: Vertical Line #2
E: Top-left corner #1
F: Top-right corner #1
G: Top-left corner #2
H: Top-right corner #2
I: Bottom-left corner #1
J: Bottom-right corner #1
K: Bottom-left corner #2
L: Bottom-right corner #2
M: Left-facing tee
N: Right-facing tee
O: UNKNOWN
P: UNKNOWN
Q: UNKNOWN
I note that the Up-facing and Down-facing tees are absent and speculate that
they are O and P but have no hard evidence of this. If anyone has a TD
outline font editor, I would be happy to get a sample of a font using them.
I also suspect that Q is a blank space.
1) Block fonts
Each char is the ASCII value that should be displayed at this point.
2) Block colour fonts
Each char has an attribute, in char, attribute format. The newlines and NULL
terminator do NOT have an attribute byte... be carefull.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment