Had space(more than 1px) between letters with custom font #6269
Replies: 1 comment
-
Posted at 2017-03-27 by @gfwilliams Looks really nice! There's no 'padding' in
Posted at 2017-03-27 by Mrbbp thanks @gfwilliams, and if i follow, the "10" is the step for letter width + kerning? The other way: Posted at 2017-03-27 by Mrbbp I've try to compile with static width but the font doesnot seems to work, i've got an error with setDennisFont16() fonction... Posted at 2017-03-27 by Mrbbp @gordon, it works, BUT, the DennisFont has no fixed width. there is less width for an "i" or "l" than a "e"... and there is a gap...
it does not work for fine letter as i, l any idea? Posted at 2017-03-27 by @gfwilliams I guess the font tool adds just 1px of padding, and it isn't configurable. Unfortunately it looks like it's server-side so you can't easily fix that. You could use the command-line tool that i originally made, and could modify the place where that adds an extra column? https://github.com/espruino/Espruino/blob/master/scripts/create_custom_font.js#L58 I guess what you could do is use Espruino to re-encode the fonts yourself. I'll see if I can come up with an example. Your use of Posted at 2017-03-27 by @gfwilliams Ok, so this is more for your interest than anything else. Using an Espruino Pico with a PCD8544 display, this code actually creates a new double-size font (with spaces) on the Espruino itself:
You could then re-encode it with It'll only work if width*height of each character in the new font is a multiple of 8, but for your case that should be fine. You should be able to modify that to just print your existing font (not doubling the size) while also adding a blank column. Honestly though - I'd just use the code I linked above and change the number for padding :) Posted at 2017-03-27 by Mrbbp Many Thanks @gfwilliams, it works great!
regards éric Attachments: Posted at 2017-03-28 by @gfwilliams Looks great! I quite like the pixellated look, but if you did want to do your own font it should be possible to find/make some tool that created a higher resolution font tile that you could then import. Posted at 2017-04-14 by @MaBecker Hi @mrbbp, like the small oleds you are using, can you please share where you ordered them? @gfwilliams this is what I was thinking about for #978 - thanks for sharing! Posted at 2017-04-14 by Mrbbp Hi @MaBecker, Posted at 2017-04-14 by Mrbbp And i discovered that the é was 1pix larger. I redesign minus with 1 pix larger.
require("FontDennis8Alt").add(Graphics);
Posted at 2017-04-14 by @MaBecker Thanks, can you please share a link, because the last one I ordered did not work(ebay.de/itm/201537040004). Posted at 2017-04-15 by Mrbbp http://www.ebay.fr/itm/172435137027?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT Posted at 2017-04-16 by @MaBecker Thanks Posted at 2017-04-18 by @gfwilliams Yes, I know what you mean about #978, but I think it's a pretty rare use case when the vector fonts are available - and it's pretty easy to work around with the font that @mrbbp has just posted. @mrbbp do you want to add this as a new font library on the Espruino site? Posted at 2017-04-18 by Mrbbp @gfwilliams Yes, but i'm not the original designer, i just modified the minus and accents... You have to ask to DennisFont designer... Regards Posted at 2017-04-18 by Mrbbp By the way @gfwilliams, does the ide use a cache when compile with a new module? Regards Posted at 2017-04-18 by @gfwilliams The IDE shouldn't cache the module... Are you serving it from a website somewhere? It could be that the website doesn't transfer it with the no-cache headers so something along the line (maybe even just Chrome) is cacheing it for you. Posted at 2020-05-20 by Mrbbp Hello, I go back up and update this post with a question about kerning again! (yes i'm graphic designer with graphic design concerns) I asked my students to draw a ** slanted ** font on an LED matrix to be able to work on the graphics of the texts displayed. (of course if the work is successful we will share the drawn fonts) This time I need to decrease the space between the letters (i think, not sure) Perhaps I am wrong on the mode of operation, but if the text algorithm, detects the last drawn pixel of a letter then adds a space of 1 pixels, on a slanted font, the kerning will be too large. I wish I could chain the letters a pixel or two kerning, like the example provided. (for my point of view, the kerning is too short) @gfwilliams, Do you think DrawString is able to draw font as in the picture? Attachments: Posted at 2020-05-20 by Mrbbp some other test The first pic is with a kerning of 2 px (as it should be) Attachments: Posted at 2020-05-20 by @gfwilliams Hi - I'm afraid right now drawString won't handle any kind of overlap at all :( What I'd suggest is maybe drawImage? There's a neat function called So you could do:
Then create your own drawString function? Posted at 2020-05-20 by Mrbbp ok! well and after using in Photoshop it's call "product" mode. black is transparent (0), white is opaque (1) é. Posted at 2020-05-21 by NebbishHacker Here's a method to draw some text with whatever adjustment to the spacing you want:
Posted at 2020-05-22 by Mrbbp thanks @nebbishhacker, but the question is now to overlap on previous drawn letter. Posted at 2020-05-22 by NebbishHacker You can make the letters overlap by passing a negative spacing into the function I posted:
Posted at 2020-05-23 by Mrbbp Thanks @nebbishhacker for the code.
Attachments: Posted at 2020-05-24 by NebbishHacker Nice, looks like a good solution :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-03-25 by Mrbbp
Hello,
I'm newb with espruino (i love using javascript for produce string... So gorgeous in front arduino...)
Sorry for the stupid question.
I've customized DennisFont8 to produce a DennisFont16, it works, but there is only 1 px (one pixel) between each letter, is there a way to had one more?
To have 2 pix in fact.
Best regards
éric
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions