Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Characters missing from Symbol font file - only in Delphi program


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jan 19, 2016 4:55 AM Last Post By: Arthur Hoornweg Threads: [ Previous | Next ]
Bob Richardson

Posts: 10
Registered: 6/7/00
Characters missing from Symbol font file - only in Delphi program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 11:49 AM
This is an error I can not reproduce. It only seems to occur on some computers in Eastern Europe (EE). When my Delphi program tries to disiplay certain characters from the Symbol.ttf font file, all that appears is an empty box. When these EE computers review the Symbol font file with a program like Character Map or Word, all the appropriate characters appear. When viewed with a Delphi program (two different programs) an empty box appears - but only on these EE computers.

The "missing" characters from the Symbol file are #161-163, 165(infinity), 170(the spade), 175, 177, 178, 179, 185, 186, 188,189, etc. ...roughly half the characters from 161 to 254 are missing. For example, to display the club symbol I put chr(167) in a string field. Works fine. To display a spade, I put chr(170) in a string field and it works fine - except for the handful of PCs in EE.

This problem does not occur on other font files I've tried, although I haven't checked too many others, and it only occurs on these EE computers.

I am using Delphi XE Starter, Win7. The EE computers include 3 Win7 and one Win 8.1 PC. My app runs correctly in more than a dozen countries.

Edited by: Bob Richardson on Oct 28, 2015 11:49 AM
Arthur Hoornweg

Posts: 414
Registered: 6/2/98
Re: Characters missing from Symbol font file - only in Delphi program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 19, 2016 4:55 AM   in response to: Bob Richardson in response to: Bob Richardson
Bob Richardson wrote:

The "missing" characters from the Symbol file are #161-163, 165(infinity), 170(the spade), 175, 177, 178, 179, 185, 186, 188,189, etc. ...roughly half the characters from 161 to 254 are missing. For example, to display the club symbol I put chr(167) in a string field. Works fine. To display a spade, I put chr(170) in a string field and it works fine - except for the handful of PCs in EE.

This problem does not occur on other font files I've tried, although I haven't checked too many others, and it only occurs on these EE computers.

What you are trying to achieve is to print the n'th character of a font regardless of code page or locale. However, in your Delphi version, CHR(n) returns an unicode result which behaves differently.

Try using the ANSI version of TextOut (TextOutA) for a more predictable result. Does the following work for you?

... uses Windows;
 
Procedure PlotSymbol (HDC:thandle; xpos,ypos:integer; CharacterNumber:Byte);
Var a:AnsiChar;
Begin
  a:=ansichar(CharacterNumber); //typecast
  windows.TextOutA (HDC, xpos,ypos,@a,1);
End; 
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02