Skip to content

Commit 445111d

Browse files
committed
Add VGA style fonts
1 parent de6e96d commit 445111d

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

info/Fonts.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ Current modules are:
118118
| ![](FontTeletext10x18Mode7.js) | [[FontTeletext10x18Mode7.js]] | Fixed width Teletext / BBC Micro "MODE 7" font, UK character set, with interpolated pixels as intended |
119119
| ![](FontTeletext5x9Ascii.js) | [[FontTeletext5x9Ascii.js]] | Fixed width Teletext / BBC Micro "MODE 7" font, 7-bit ASCII, with original structural pixels only |
120120
| ![](FontTeletext5x9Mode7.js) | [[FontTeletext5x9Mode7.js]] | Fixed width Teletext / BBC Micro "MODE 7" font, UK character set, with original structural pixels only |
121-
121+
| ![](FontVGA8.js) | [[FontVGA8.js]] | Fixed width 8x8 PC VGA-style font |
122+
| ![](FontVGA16.js) | [[FontVGA16.js]] | Fixed width 8x16 PC VGA-style font |
122123

123124
Use these as follows:
124125

@@ -225,7 +226,7 @@ Graphics.prototype.drawStringDbl = (txt,px,py,h)=>{
225226
g2.drawString(txt);
226227
var img = {width:w*2,height:1,transparent:0,buffer:new ArrayBuffer(c)};
227228
var a = new Uint8Array(img.buffer);
228-
for (var y=0;y<h;y++) {
229+
for (var y=0;y<h;y++) {
229230
a.set(new Uint8Array(g2.buffer,32*y,c));
230231
this.drawImage(img,px,py+y*2);
231232
this.drawImage(img,px,py+1+y*2);

modules/FontVGA16.js

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/FontVGA8.js

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)