|
Post by anonymous on Nov 4, 2008 21:22:27 GMT 2
Hello hukka, I recently took some time to try and have a look at some .bdf files using Fony 1.4.0 alpha (Release date 2008-10-22). Sadly I have discovered that there are some problems with the .bdf import function. It appears, from my own past experience, that you are having some problems with things due to an incorrect and/or inconsistent 0 or 1 starting point in your math. You know, 5 elements in an array indexed 0...4, etc. Below are a few cited examples which should clearly demonstrate the bugs. When importing c64.bdf from the link below, ... C64 BDF X Font - 8x8 font BDF beej.us/c64bdf/... the baseline is up one row too high and the height is one row too high, 9 instead of 8 pixels. When importing .bdf fonts from the link below, ... Scott Lawrence's Commodore Amiga Bitmapped Fonts in BDF Format umlautllama.com/projects/font/(Direct file link) umlautllama.com/projects/font/bdf/UmlautLlamaFonts_0003.tar.gzthe following fonts have the following problems Commodore_Helvetica_11.bdf "j" and "y" have truncated width Commodore_Times_11.bdf "j", "p", and "y" have truncated width Commodore_topaz_11.bdf & Commodore_topaz2_8.bdf the baseline is up one row too high I have also tried some other .bdf fonts from other sources and found similar problems. This leads me to believe that the problem is not in the data files, but rather Fony. This is an example of something that needs to be fixed before new features are added. I will get back to you later with some new features that I feel need to be added. Thanks, anonymous [AVRRQPYNNZJUY]
|
|
|
Post by hukka on Nov 10, 2008 13:16:22 GMT 2
Thanks for the report and sorry for the late reply! (I've been mostly playing with my new Eee PC lately instead of doing any real work.)
I'll take a look at the BDF code. I didn't have a lot of different BDF fonts to test with when I was coding BDF support.
|
|
|
Post by hukka on Nov 10, 2008 19:19:03 GMT 2
A quick search didn't find a BDF viewer I could use to verify the BDF files, but I converted the files to bitmaps using the BDF2BMP program and judging from its output, the problem seems to be with the BDF files themselves.
The converter crashed with the proportional fonts you mentioned, and the Topaz fonts seemed to be parsed similarly to Fony. I guess it's the Amiga font guy's BDF converter at fault here?
Can you give me some other BDF files created with something else to verify?
|
|
|
Post by anonymous on Nov 11, 2008 4:47:24 GMT 2
Sure. OK. "Eee PC | Easy to Learn, Work and Play" (as seen on eeepc.asus.com/global/)I guess you are leaning more toward "Play" than "Work" or "Learn." I have been familiar with ASUS since way back around 1990 when I saw one of their new 80486 motherboards. As far as I know, they have been been producing consistently good products ever since. Enjoy! Understood. It is always hard to find something when you need it. I see. It seems that it is a rare thing to find any software that supports BDF files on Windows. It is easy on Linux. Where can I find the BDF2BMP that you used? Was it on running on Windows? It could be, I have no way of knowing. I would think that he would notice such an error. He did state that there might be some inaccuracies in his conversion program's output. This one is having problems with the character cells being too tall, 17 high instead of 16 high, and the base line is up 4 rows from the bottom but down one row from the baseline of the letters. I do not understand how the height can be 17 when there is no mention of 17 in the BDF file in any place other than in COMMENTS, STARTCHAR, and ENCODING. Those instances should not affect the height. xent.com/~bsittler/iso_scan_font.bdfIt is discussed here: zestyping.livejournal.com/16879.htmlI hope that this one is sufficient to demonstrate that ther is something wrong, or not! I apologize if I have lead you down the wrong path due to the BDF files being in error. I just find it to be strange that all the ones that I would try first would have similar issues. If you need more, let me know and I will search for them. Thanks, anonymous [AVRRQPYNNZJUY]
|
|
|
Post by hukka on Nov 11, 2008 15:50:42 GMT 2
I took a better look and the only thing I found wrong with Fony was the height calculation, which is now fixed. Some of the amiga fonts are indeed broken and some BDF fonts in general seem to have incorrect ascender positions. As I understand it, the descender in iso_scan_font is specified incorrectly as 3, when it should be 4. There simply seem to be too many badly converted BDF fonts around. I tested some BDF font packs I found on my hard drive and they all displayed correctly, base line and all, now that I fixed the height calculation. (I was basically ignoring the PIXEL_SIZE property if there was one, plus I had an extraneous "+1" in the code.) I couldn't make BDF2BMP display ascender lines so it's pretty useless for testing, same with another program I found called BDFViewer. hukka.furtopia.org/projects/fony/test/Fony.exe
|
|
|
Post by anonymous on Nov 11, 2008 18:37:50 GMT 2
I took a better look and the only thing I found wrong with Fony was the height calculation, which is now fixed. Excellent! It is good to hear that you located and corrected the small bug. It feels good to know that I contributed in some way. OK, it is unfortunate that there appear to be problems in the BDF files that I brought to your attention. Yes, indeed. (I believe you meant "created" rather than "converted") It seems that there is a general lack of knowledge in this file format. As an aside, you might consider creating a document describing the finer points of the BDF file format in the hope of setting people straight. Nice to see everything is working now. (Cool, I knew there was a +1 error in there.) Understood. Thanks for the updated exe! Thanks again, anonymous [AVRRQPYNNZJUY]
|
|
|
Post by anonymous on Nov 11, 2008 20:17:49 GMT 2
hukka, We spoke too soon... There still seems to be a problem. Get the 5x9 BDF font at: www.timeguy.com/cradek/01128220822Import it into Fony. Paste the text between the lines below into the Font Preview window. ----------------------------------- A good tiny X font I sometimes find myself using a low-resolution screen and I want as small a font as possible while still having it readable. Some time ago I made this 5x9 font and I've used it since. I think it's the best font of its size possible. Files attached to this page: 5x9.bdf 22.5kB smallfont.png 1.3kB ----------------------------------- Set the foreground color to white and the background color to black. Take a screenshot of the Font Preview window and paste it into a graphics editor. Take the image from the font's web page and paste it in a layer on top of the screenshot of Fony's Font Preview. Align the letter "A"s in the upper left corner to fall on top of one another. Now repeatedly show and hide the web page image to get a glimpse of how the two renderings of 5x9 differ. The differences you will see are due to the letters "r" and "c" that occur a total of six times in the text. Those two letters, for some unknown reason, render in Fony with a width of six while the font is supposed to be five wide. There are actually a total of eleven characters that appear in Fony with a width of six. Here they are in decimal values and their glyph: 55 7 66 B 69 E 99 c 114 r 170 ª 215 × 221 Ý 223 ß 230 æ 247 ÷ Please take a look at this and let me know what you find. Thanks, anonymous [AVRRQPYNNZJUY]
|
|
|
Post by hukka on Jan 5, 2009 17:06:33 GMT 2
Sorry I didn't reply sooner - I didn't realize you had made another post. Thanks for bringing this latest problem to my attention.
This seems to be another case of a buggy BDF file - the glyphs you mention ARE correctly parsed by Fony as far as I understand the BDF file specification. Their BBw (width of black pixels in the glyph) is set to 5 in the BDF file, whereas other glyphs have a BBw of 4.
I could make Fony 'crop' all glyphs to the width specified in FONTBOUNDINGBOX, which would get rid of the bugs in at least this particular BDF, but I'm not sure if it would break some other BDF files. The whole BDF format is kind of unnecessarily complicated and the specifications are way too terse in parts. I'll look into it.
|
|
|
Post by hukka on Jan 5, 2009 17:54:02 GMT 2
|
|
|
Post by anonymous on Jan 9, 2009 0:06:54 GMT 2
Sorry I didn't reply sooner - I didn't realize you had made another post. No problem, it was quite a long wait though Sure. See below. OK, I downloaded the new Fony.exe and gave it a test. I do see that the characters I mentioned are now staying within the correct width, but they now have a new issue with the right edge pixels being cropped off. You mentioned that the BBw of these characters is 5 and others are 4, this may be correct and not an error. For example, character 215 (multiply sign) is 5 pixels wide. I will admit that I had a look at the BDF file spec form Adobe and gave up trying to figure out what things do. I agree that it is overly complicated and somewhat vague. Anyway, I still think that there may be a different problem than the one you suspect as being the cause. I suggest taking a look to see if you can find something else in common with the characters that I pointed out that is not found in all the rest. And now another bug or bugs... I have tried to export and import a full 256 character font as a Bitmap Font Writer font and a Bitmap font. In both cases I am unable to get results. In the case of the Bitmap Font Writer format, I am unable to import or export a font with characters before 33 and also notice that there is a character 32 (space) added after importing. Without any prior knowledge of this format, and no instructions for Fony (nudge, nudge), I do not know if this is intended. If it is an intended behavior, then you need to alter the Export Bitmap dialog to limit the range start to a minimum of 33 for the Bitmap Font Writer format. In the case of the Bitmap font format, the export of all 256 characters works fine, but I can't import that file back in without loss of columns of pixels in each character read in. I also notice that the first character cell on the left, as indicated by the red outline and tick mark, seems to be wider than the following cells. I really can't go into greater detail, please play with this to see what I mean. Lastly, the reason for my exporting and importing is to achieve something that Fony can't do at present. For example, I would like to take the first 128 characters of one existing font and the last 128 characters from another existing font and merge them to produce a new 256 character font. I could do that using an image editor and two exported fonts, if only I could get it to work. You might consider making a feature that would allow for the copying of (a) selected character(s) from one font file to another. Thanks, anonymous [AVRRQPYNNZJUY]
|
|
|
Post by hukka on Jan 9, 2009 14:37:37 GMT 2
OK, I downloaded the new Fony.exe and gave it a test. I do see that the characters I mentioned are now staying within the correct width, but they now have a new issue with the right edge pixels being cropped off. You mentioned that the BBw of these characters is 5 and others are 4, this may be correct and not an error. For example, character 215 (multiply sign) is 5 pixels wide. I will admit that I had a look at the BDF file spec form Adobe and gave up trying to figure out what things do. I agree that it is overly complicated and somewhat vague. Anyway, I still think that there may be a different problem than the one you suspect as being the cause. I suggest taking a look to see if you can find something else in common with the characters that I pointed out that is not found in all the rest. I'm fairly sure it's still a malformed BDF file. I loaded the font into FontForge which too shows the right side of some characters as going out of limits. I can still code a workaround for that, though, but... I think 5x9 is supposed to be a monospaced font; "fixing" the multiply sign (and other glyphs' widths) would make these glyphs wider than the other glyphs, resulting in a proportional font which would be no good to use on console windows. Okay, I'll just detect this while importing and ask the user what should be done. Will take some time to implement, though. That's odd and definitely not intended behavior. I thought I had tested these features enough to weed out all bugs. Guess I'll have to look further into it. For now, you can fire up two instances of Fony and copy/paste glyphs between them one at a time. Tedious, yeah, I'll see if I can at least implement a way to copy and paste multiple glyphs at once. I'll keep you posted on any developments.
|
|
|
Post by anonymous on Jan 10, 2009 18:20:11 GMT 2
I'm fairly sure it's still a malformed BDF file. I loaded the font into FontForge which too shows the right side of some characters as going out of limits. I can still code a workaround for that, though, but... I think 5x9 is supposed to be a monospaced font; "fixing" the multiply sign (and other glyphs' widths) would make these glyphs wider than the other glyphs, resulting in a proportional font which would be no good to use on console windows. Okay, I'll just detect this while importing and ask the user what should be done. Will take some time to implement, though. Sounds good, thanks. Thanks. Yes, I knew that characters were copyable one at a time, tediously. Thanks. One more request. Since all of the apparent confusion in the BDF file spec seems to be in the bounding box compression, could you provide an option to export to a BDF without compression? This will help to ensure that a BDF file created by Fony can be correctly read into a program (in uncompressed BDF format) that has things incorrectly implemented in the bounding box logic. This also allows for easier BDF file reading in ones own custom programs. Thanks, anonymous [AVRRQPYNNZJUY]
|
|
|
Post by hukka on Feb 13, 2009 17:17:47 GMT 2
Hi, to prove I still exist there's now a test build of Fony in the test directory that supports selecting, copying and pasting a range of glyphs at once. Also 'effects' such as invert, mirror, boldify etc. now apply to the selected glyphs instead of only current glyph. Use shift to select a range using the glyph list bar. hukka.furtopia.org/projects/fony/test/Fony.exe
|
|
|
Post by hukka on Apr 26, 2009 20:21:48 GMT 2
Okay, I don't know if you're still around, but I've fixed things with BDF and Bitmap Font Writer import and export: * BDF Export dialog with the option to export glyphs without trimming off padding from glyph edges, to get around faulty bounding box calculations of some programs. (I didn't test this much though) * BDF Import asks whether to preserve or crop glyphs with invalid width. * Exporting a bitmap in Bitmap Font Writer format ignored range settings. * Bitmap Font Writer asks for ASCII value of first glyph in bitmap. hukka.furtopia.org/projects/fony/
|
|