Post Reply 
DB48X: HP48-like RPL implementation for DM42
Yesterday, 05:11 PM
Post: #504
RE: DB48X: HP48-like RPL implementation for DM42
(12-16-2024 02:17 PM)n1msr Wrote:  The DB48X project is ongoing and interesting.

I wanted to try an alternative font or two and this is relatively easy given that the release for the calculator can be obtained from Github (thank you c3d).

There are potential copyright issues with some fonts, so I am ignoring that here, because many are free for private use. What I am interested to know is if there is a deterministic way to get the parameters for the ttf2font code (in the build for db48x) that takes a TTF file and creates a set of four ".cc" file as per the Makefile (lines 182 through 189).

The three parameters are below (specified in ttf2font in the tools directory). You can see them used in the Makefile after the BASE_FONT is specified. In the release, the BASE_FONT is FogSans-ddd.ttf.

-s: this is the fontSize - this is the place to start I think, and then adjust the next two parameters to make the fontSize work for the calculator display.
-S: heightPict (this is also described as scaling)
-y: yAdjustPixles (this always needs some adjusting from -10 through 0 to +10 based on my experience with the fonts I have used so far. It keeps the bottom of the characters towards the base or the floor of the display space they occupy (e.g. in the softkey and the stack displays).

I have to play about with the numbers to get something that eventually "fits" the four calculator fonts: Stack, Editor, Reduced (the softkeys I think) and Help. Luckily the sim[ulator] can be used for preliminary testing, which is quite quick. I would prefer that when I try a new font, I get to a working set of parameters quicker than I do :-)

If you have any hints/tips from your experience, please share them. Thank you.

I don't think there is any magic trick, which is why I had to add these parameters. Turning an outline font into a small-size bitmap is an art form. As you and I discussed elsewhere, the C47 team went through the trouble of pixel-editing their fonts, which makes them look a little better, but then much harder to modify, reuse or extend.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DB48X v0.4.8 is out - c3d - 10-22-2023, 11:31 PM
Release v0.5.0: Statistics and flags - c3d - 11-20-2023, 08:57 AM
v0.6.5: Minor bug fixes - c3d - 02-11-2024, 11:23 PM
Release 0.7.1 "Whip" - Bug fixes - c3d - 03-04-2024, 12:46 AM
DB48X v0.7.4 release is out - c3d - 04-14-2024, 03:05 PM
DB48X v0.7.6: Solving menu - c3d - 05-13-2024, 12:04 AM
DB48X v0.7.7: Units in solver - c3d - 06-02-2024, 11:36 PM
v0.7.10 - Interactive stack - c3d - 07-14-2024, 11:31 PM
DB48X v0.7.13 is out - c3d - 08-05-2024, 07:31 AM
DB48X v0.7.15 - c3d - 08-25-2024, 08:45 PM
DB48X v0.7.16 - c3d - 09-02-2024, 01:36 AM
DOSUBS command - grbrum - 09-04-2024, 03:37 PM
v0.7.18 - APPLY, SUBST, WHERE - c3d - 09-15-2024, 11:58 PM
Program Editing Question - spiff72 - 09-16-2024, 03:27 PM
press 2 simultaneous buttons? - grbrum - 09-30-2024, 09:01 PM
CST Custom Menu - grbrum - 10-04-2024, 05:00 AM
v0.8.2: Assignments, Custom menu - c3d - 10-21-2024, 05:49 AM
CST - grbrum - 11-05-2024, 08:07 PM
Stuttgart video - c3d - 11-07-2024, 08:22 PM
Long Name Menus - usability - grbrum - 11-08-2024, 07:47 PM
Release v0.8.5: Keyboard fixes - c3d - 11-12-2024, 01:05 AM
CONVERT bug - grbrum - 11-12-2024, 07:44 PM
Christmas wishlist is open - c3d - 12-02-2024, 07:09 PM
DB48X/50X CATALOG 'behaviour' - n1msr - 12-03-2024, 10:24 AM
DB48x v0.8.8 - Power usage reduction - c3d - 12-08-2024, 11:40 PM
RE: DB48X: HP48-like RPL implementation for DM42 - c3d - Yesterday 05:11 PM



User(s) browsing this thread: 8 Guest(s)