Want to change DefaultTTFFontForBigFont.

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: support, SDS, admin

Post Reply
Posts: 1
Joined: 21 Oct 2016, 07:09

Want to change DefaultTTFFontForBigFont.

Post by kokada » 18 Jun 2019, 10:20

Hello, we are using CAD VCL Enterprise 14
for converting dwg/dxf files to PDF .

I've found that it drops Japanese glyphs in that process,
in some Windows 2008/2012 servers .

I've debugged the program with Delphi debugger and found the cause,

in sgConsts.pas, you define
cnstDefaultTTFFontForBigFont := 'Arial Unicode MS' .

CAD VCL try to use 'Arial Unicode MS' first, but when it can't find this font,
it uses 'Arial' instead , which doesn't have enough glyphs to show Japanese text .

Because 'Arial Unicode MS' is not a standard pre-installed font on Windows Servers,
We want to provide another Unicode font which is actually found on the system,
as the default TTF FontForBigFont,

Will you give me some way to override the DefaultTTFFontForBigFont value ?

-------------just a comment:
In the same unit, you have a variable
sDefaultTTFFont: string = cnstDefaultTTFFont;

I think this was introduced to the unit so that the developer can
override the DefaultTTFFont value, but unfortunately, this variable is
just declared but abondoned and never used .

So, my suggestion / wish is
to define a global variable
sDefaultTTFFontForBigFont: string = cnstDefaultTTFFontForBigFont;
and replace
cnstDefaultTTFFontForBigFont with sDefaultTTFFontForBigFont
and cnstDefaultTTFFont with sDefaultTTFFont also in the implementation.

Then we could use any TTF font actually available on the system
as the default font.

-------------grep result for DefaultTTFFont ------
DXFConv.pas(13358): AFontName := cnstDefaultTTFFont;
DXFConv.pas(16982): Result := cnstDefaultTTFFontForBigFont
DXFConv.pas(16984): Result := cnstDefaultTTFFont;
DXFConv.pas(21221): Result := cnstDefaultTTFFont;
DXFConv.pas(32075): Properties.FFontName := cnstDefaultTTFFont;
DXFConv.pas(32359): Properties.FFontName := cnstDefaultTTFFontForBigFont;
sgConsts.pas(3987): // cnstDefaultTTFFont = 'Arial';
sgConsts.pas(3989): // cnstDefaultTTFFont = {$IFDEF SG_BTI_INTERFACE}'Gost'{$ELSE}'Arial'{$ENDIF};
sgConsts.pas(3991): cnstDefaultTTFFont = {$IFNDEF SG_NON_WIN_PLATFORM}'Arial'{$ELSE}'FreeSans'{$ENDIF};
sgConsts.pas(3992): cnstDefaultTTFFontForBigFont = {$IFNDEF SG_NON_WIN_PLATFORM}'Arial Unicode MS'{$ELSE}'FreeSans'{$ENDIF};
sgConsts.pas(4641): sDefaultTTFFont: string = cnstDefaultTTFFont;
TTF.pas(2711): J := IndexOf(cnstDefaultTTFFont, Style, cnstCharSetDef);
TTF.pas(2715): FDefaults[PByte(@Style)^ and $3] := AddTextGlyphsByFont(cnstDefaultTTFFont, Style)
TTF.pas(2813): Result := AnsiSameText(ATextGlyph.FontName, cnstDefaultTTFFont) or
TTF.pas(4303): FreeTypeFont := TFreeTypeFontAccess(GetFreeTypeFont(cnstDefaultTTFFont, []));

Posts: 2930
Joined: 30 Mar 2005, 11:36

Re: Want to change DefaultTTFFontForBigFont.

Post by support » 18 Jun 2019, 19:35


CAD VCL development team has decided to follow your suggestion and implement a way of altering the DefaultTTFFontForBigFont value. I have opened a support case for this matter.

Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply