Здравствуйте. Пишу приложение, которое должно сохранять нарисованые пользователем картинки в фалй .FNT (простите за древний формат, это необходимость). Стал разбираться с форматом файла. Неясен следующий момент:
"fFirstChar 1 byte specifying the first character code defined by
this font. Character definitions are stored only for
the characters actually present in a font. Therefore,
use this field when calculating indexes into either
dfBits or dfCharOffset.
dfLastChar 1 byte specifying the last character code defined by
this font. Note that all the characters with codes
between dfFirstChar and dfLastChar must be present in
the font character definitions.
dfDefaultChar 1 byte specifying the character to substitute
whenever a string contains a character out of the
range. The character is given relative to dfFirstChar
so that dfDefaultChar is the actual value of the
character, less dfFirstChar. The dfDefaultChar should
indicate a special character that is not a space.
dfBreakChar 1 byte specifying the character that will define word
breaks. This character defines word breaks for word
wrapping and word spacing justification. The character
is given relative to dfFirstChar so that dfBreakChar is
the actual value of the character, less that of
dfFirstChar. The dfBreakChar is normally (32 —
dfFirstChar), which is an ASCII space."
1 байт, определяющий код первого символа шрифта — какой код должен быть? Использовать обычную таблицу ASCII?
Кроме того, упомянуто, что это поле будет использоваться для подсчета индексов в dfBits или dfCharOffset. Таких полей в описании формата нет!
1 байт, определяющий код последнего символа — тот же вопрос.
Символ, определяющий замену, если строка содержит символ, отсутствующий в диапазоне (символов?). Сказано, что он "относителен" от dfFirstChar, поэтому он ялвяется "актуальным значением" символа, меньшего dfFirstChar. Что это за символ? Как он может выглядеть, если далее указано, что это не пробел. Каково его значение?
1 байт, определяющий символ для отделения слов друг от друга. Он ТОЖЕ меньше dfFirstChar, и обычно его значение 32-dfFirstChar (и каково же оно?) и обычно является пробелом. Смотрим в ASCII таблицу: пробел — это символ с кодом 32. Получаем 32 = 32 — dfFirstChar => dfFirtChar = 0.
32 < 0??? Ничего не понимаю.