utf-8 for RPL source code
04-23-2015, 01:10 PM
Post: #9
 Claudio L. Senior Member Posts: 1,678 Joined: Dec 2013
RE: utf-8 for RPL source code
(04-22-2015 10:40 PM)Helix Wrote:  So, if I understand correctly, you need 3 images, one for each font size: 5 pixels, 6 pixels and 7 pixels height. And of course, the same characters must be present in each font.

But a font with 5 pixel height is very small. Some characters will be impossible to draw at this scale ! Where these tiny characters will be used, only in the soft menus, or also in the stack?

You'll be free to select the fonts to use for each area. Any font could be used on any area (when I say area I mean: Stack, Forms, Text editor, Soft menus, Status Area). If you are crazy enough to use a 5-pixel font for the stack, so be it, the system will allow it and work with it.
Other sizes will be allowed as well, so it may make sense to have perhaps two 6-pixel fonts: one wide for the stack and text, and one very narrow (like the minifont), more adequate for soft menus where space is limited to a few letters.
If a character cannot be represented, a box is fine. You don't need to draw many boxes in the bitmap, one is enough.
When you do the list of codes in the bitmap, let's do this:
* Each glyph in the bitmap, from left to right will correspond to one line in the text file.
* Blank lines in the file will be ignored with no consequence.
* You can add comments in the text file: A line starting with // will be considered a comment. If // is found on a line after the numbers, the rest of the line will be considered a comment and disregarded.
* On each line, you put the Unicode code points that are represented by this glyph, in decimal (or hex with 0x prefix) (for example 65 for capital A).
* If there's more than one character represented by the same glyph, add them in the same line, separated by a comma.
* The first symbol, at the left of the bitmap will be the symbol used for any characters that are not listed in the text file, so this should be a generic box or something. This way, you can skip codes and don't need to add them to the list explicitly.

Let's say you start with a box and the capital letters in the bitmap, your text file could look like this:
Code:
 0 // GENERIC BOX FOR UNSUPPORTED CHARACTERS // CAPITAL LETTERS 65 // A 66 // B 67 // C ...

Notice that while I added the 0 code for the generic box, it's not necessary to add 1-31 (control characters), since they will be mapped to the box automatically.

(04-22-2015 10:40 PM)Helix Wrote:  It could be a tedious work, and I'm not ready to reinvent the wheel. I have found some examples of fonts here, but I'm not familiar with the copyright rules. For example, is a "creative commons attribution" OK for a starting point?

I'd say yes, Creative Commons is fine. All you have to do is keep track of which fonts you copy and put their respective credits in a file. We'll pick later which fonts will be in ROM and which will be loadable by the user, but the more fonts we have the better. As long as we don't violate any copyrights, we are OK. Then the ROM distribution will have to carry the credit files.
The tool to convert fonts from a normal bitmap to newRPL format will also be available separately so that users can freely create new fonts as they please. Perhaps I can even try to include one in ROM, so that you can store fonts in an SD card, and can be opened and converted on-the-fly by the calculator. But this is all up in the air right now, so far the firmware can only do +, -, * and /, that's a long way to go.
Your help will be much appreciated, so don't forget to add your own name to those credits!

And of course, if anyone else likes to design their own fonts, I invite them to join in and send some bitmaps!
 « Next Oldest | Next Newest »

 Messages In This Thread utf-8 for RPL source code - Claudio L. - 04-07-2015, 01:06 AM RE: utf-8 for RPL source code - MarkHaysHarris777 - 04-07-2015, 03:14 AM RE: utf-8 for RPL source code - Claudio L. - 04-07-2015, 01:33 PM RE: utf-8 for RPL source code - Claudio L. - 04-17-2015, 01:04 PM RE: utf-8 for RPL source code - Claudio L. - 04-21-2015, 02:06 PM RE: utf-8 for RPL source code - Claudio L. - 04-24-2015, 01:42 PM RE: utf-8 for RPL source code - Helix - 04-22-2015, 01:06 AM RE: utf-8 for RPL source code - Claudio L. - 04-22-2015, 02:08 AM RE: utf-8 for RPL source code - Helix - 04-22-2015, 10:40 PM RE: utf-8 for RPL source code - Claudio L. - 04-23-2015 01:10 PM RE: utf-8 for RPL source code - Claudio L. - 04-23-2015, 03:52 PM RE: utf-8 for RPL source code - Helix - 04-23-2015, 11:00 PM RE: utf-8 for RPL source code - Claudio L. - 04-24-2015, 01:06 PM

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