Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with font in Teletext browser.
#1
I modified a TTF font (endcoded ISO 8859-1) for a Teletext browser but there some problems when I test the font:

1) many characters are not in the place where I put them in the font. For instance. They are also in different places. 
For instance, CHR$(20) shows in QB64 a character that is in the font in the position 152 (or something). In the TTF font CHR$(20) should show nothing, it's empty in the font.

2) It doesn't show all the characters in the font, and I have no idea why. It looks very random.

Viewing text and standard characters work great (see second image).

[Image: Screenshot-2025-08-09-161055.png] [Image: Screenshot-2025-08-09-162004.png]


Attached Files
.ttf   Teletekst.ttf (Size: 16.03 KB / Downloads: 39)
Reply
#2
For Chr$(n) when n < 32 you might benefit with a command that prints control chars, now if I can only remember the name... maybe _ControlChar Smile
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#3
If you created your own font, you probably mapped the characters to unicode positions from 0 to 255.

QB64 doesn't map straight to unicode in this manner; as it uses the ASCII PAGE CODES to map to various other unicode positions.

For example, take a look at this little QB64 Program:

Code: (Select All)
$Console:Only
For i = 0 To 255
Print i, _MapUnicode(i)
Next

One the left we have the ASCII value that we map to, on the right we have the UNICODE value that it maps to. (Note that this is for the default character page 437.)

Code: (Select All)
0        0
1        9786
2        9787
3        9829
4        9830
5        9827
6        9824
7        8226
8        9688
9        9675
10       9689
11       9794
12       9792
13       9834
14       9835
15       9788
16       9658
17       9668
18       8597
19       8252
20       182
21       167
22       9644
23       8616
24       8593
25       8595
26       8594
27       8592
28       8735
29       8596
30       9650
31       9660
32       32
33       33
34       34
35       35
36       36
37       37
38       38
39       39
40       40
41       41
42       42
43       43
44       44
45       45
46       46
47       47
48       48
49       49
50       50
51       51
52       52
53       53
54       54
55       55
56       56
57       57
58       58
59       59
60       60
61       61
62       62
63       63
64       64
65       65
66       66
67       67
68       68
69       69
70       70
71       71
72       72
73       73
74       74
75       75
76       76
77       77
78       78
79       79
80       80
81       81
82       82
83       83
84       84
85       85
86       86
87       87
88       88
89       89
90       90
91       91
92       92
93       93
94       94
95       95
96       96
97       97
98       98
99       99
100      100
101      101
102      102
103      103
104      104
105      105
106      106
107      107
108      108
109      109
110      110
111      111
112      112
113      113
114      114
115      115
116      116
117      117
118      118
119      119
120      120
121      121
122      122
123      123
124      124
125      125
126      126
127      8962
128      199
129      252
130      233
131      226
132      228
133      224
134      229
135      231
136      234
137      235
138      232
139      239
140      238
141      236
142      196
143      197
144      201
145      230
146      198
147      244
148      246
149      242
150      251
151      249
152      255
153      214
154      220
155      162
156      163
157      165
158      8359
159      402
160      225
161      237
162      243
163      250
164      241
165      209
166      170
167      186
168      191
169      8976
170      172
171      189
172      188
173      161
174      171
175      187
176      9617
177      9618
178      9619
179      9474
180      9508
181      9569
182      9570
183      9558
184      9557
185      9571
186      9553
187      9559
188      9565
189      9564
190      9563
191      9488
192      9492
193      9524
194      9516
195      9500
196      9472
197      9532
198      9566
199      9567
200      9562
201      9556
202      9577
203      9574
204      9568
205      9552
206      9580
207      9575
208      9576
209      9572
210      9573
211      9561
212      9560
213      9554
214      9555
215      9579
216      9578
217      9496
218      9484
219      9608
220      9604
221      9612
222      9616
223      9600
224      945
225      223
226      915
227      960
228      931
229      963
230      181
231      964
232      934
233      920
234      937
235      948
236      8734
237      966
238      949
239      8745
240      8801
241      177
242      8805
243      8804
244      8992
245      8993
246      247
247      8776
248      176
249      8729
250      183
251      8730
252      8319
253      178
254      9632
255      160

So note that when you print CHR$(20), what gets displayed is UNCODE character(182) -- which is what you indicated above (though with the value off, and a note of *or something* to show the value is off.)

The solution here is probably just to make certain that you map your CHR$ values to your font positions as you've created them in your custom font.

Code: (Select All)

FOR i = 0 to 255
_MAPUNICODE i, i
NEXT

With the above, you'll map your ASCII values (and CHR$ values) from 0 to 255 to your font characters from position 0 to 255.

I imagine that little change above will fix the issues you're having with your custom font. Map things to the corresponding place in your font, rather than where they map off to by default with CODE PAGE 437 in use.
Reply
#4
Thank you! That solved it! I had to replace TO with a , though.

(08-09-2025, 11:34 PM)bplus Wrote: For Chr$(n) when n < 32 you might benefit with a command that prints control chars, now if I can only remember the name... maybe _ControlChar Smile
Thanks, Mapunicode did the trick.
Reply
#5
(08-10-2025, 12:33 AM)SquirrelMonkey Wrote: Thank you! That solved it! I had to replace TO with a , though.

Sorry about that. I had the problem diagnosed right; just the syntax on the command wrong. Glad you managed to sort it all out and get it working as intended. Wink

Note that you might want to store the old values in an array or something, for ease of restoring to the normal character set, if you decide to change fonts later and print other stuff onto the screen which isn't part of your custom font.
Reply
#6
"I had the problem diagnosed right"

And the solution. QB64 gave me as feedback that it has to be "TO", but I didn't even know that the command existed.
And I am happy that you responded because I had no idea how to solve it.
Reply
#7
I'd be interested to see the code you created to play with TT myself  Smile
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply
#8
A Teletext browser? Is Teletext even still alive?
I know that NOS (I see from your screenshot) continued with Teletext lately.
VRT (then still BRT) stopped offering it long ago.
Sowieso, succes met de brower. Ik ben benieuwd naar het eindresultaat.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm looking for suggestions to solve the problem! Petr 10 649 02-05-2026, 04:56 PM
Last Post: ahenry3068
  Nth problem with hardware images Ikerkaz 9 470 01-23-2026, 02:58 PM
Last Post: bplus
  Install problem...... jssantoro 6 380 12-17-2025, 08:31 PM
Last Post: madscijr
  Font Size in Threads Dimster 5 356 12-12-2025, 04:49 PM
Last Post: Dimster
  maths problem with percentage pmackay 3 527 09-04-2025, 09:57 AM
Last Post: pmackay

Forum Jump:


Users browsing this thread: 1 Guest(s)