I could do it based on descriptions of the LOGFONT structure only if the font was selected by vpiCommonDialogs::getFont. The procedure fontCreateByName does not set some bytes of the font structure. Here are the differences
Code: Select all
The message font is Andale Mono.
Byte Source FontGetByCommonDial FontCreatedByName Difference
v- Index Size -> 92 92 0
23 255 y 1 special Different
24 1 special 0 special Different
25 2 special 0 special Different
26 1 special 0 special Different
27 49 1 0 special Different
typedef struct tagLOGFONT {
00-03 LONG lfHeight;
04-07 LONG lfWidth;
08-11 LONG lfEscapement;
12-15 LONG lfOrientation;
16-19 LONG lfWeight;
20 BYTE lfItalic;
21 BYTE lfUnderline;
22 BYTE lfStrikeOut;
23 BYTE lfCharSet;
24 BYTE lfOutPrecision;
25 BYTE lfClipPrecision;
26 BYTE lfQuality;
27 BYTE lfPitchAndFamily;
28-... TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT;
Member Value Description
FamilyDecorative 80 Specifies a novelty font; for example, Old English.
FamilyScript 64 Specifies a font that is designed to look like handwriting; for example, Script and Cursive.
FamilyModern 48 Specifies a monospace font with or without serifs. Monospace fonts are usually modern; examples include Pica, Elite, and Courier New.
FamilySwiss 32 Specifies a proportional font without serifs; for example, Arial.
FamilyRoman 16 Specifies a proportional font with serifs; for example, Times New Roman.
FamilyDoNotCare 0 Specifies a generic family name, which is used when information about a font does not exist or does not matter. The default font is used.
MonoFont 8 Specifies a monospace font.
VariablePitch 2 Specifies a variable-pitch font.
FixedPitch 1 Specifies a fixed-pitch font.
DefaultPitch 0 Specifies default pitch.
Code: Select all
predicates
% 2014.10.22. Is the font monospace or proportional?
fontClass:() -> font_class procedure.
fontClassAux:(unsigned8 PitchAndFamily, unsigned8 Eigth) -> font_class procedure.
clauses
fontClass()=fontClassAux(PitchAndFamily,PitchAndFamily div 8) :-
F=selectedFont,
PitchAndFamily=binary::getIndexed_unsigned8(F,27),
succeed().
fontClassAux(0,_)=fontClassFromCreation :-
!.
fontClassAux(_,1)=monospace :-
!.
fontClassAux(_,6)=monospace :-
!.
fontClassAux(_,_)=proportional.
Code: Select all
new_by_other_font_descriptor(fo(FontName,SSName,FontClass,IsBold,IsUnderlined,IsItalic,Size)) :-
fontClassFromCreation:=FontClass,