Home › Evil Mad Scientist Forums › Egg-Bot › Hersheytext and Accents
- This topic has 7 replies, 5 voices, and was last updated 10 years, 8 months ago by ragstian.
-
AuthorPosts
-
October 4, 2012 at 5:14 am #20114daxbotParticipant
Just assembled my Eggbot in France, and running my first test plots – very happy so far… until I tried using some of the text-based extensions that rely on Hersheytext : any accents, Euro/Pound symbols just get ignored.
So if I enter :
Sömê äçcéntèd chàrâchtërs ãnd symbõls: ù§€$£all I get out is :
Sm cntd chrchtrs nd symbls: $From a quick web search, it seems that Hersheytext is capable of plotting these characters, but perhaps this is an eggbot-specific version ?
Any ideas on how to make this more “international-friendly” ?
October 4, 2012 at 1:18 pm #20916Windell OskayKeymasterFirst off, the Hershey Text extension included with the Eggbot distribution is the same version that was released on our web site.
So far as I remember, the fonts that we adapted did not directly include these extra symbols. The symbols included are displayed with the glyph table, and we did not edit or remove any symbols intentionally. There are *some* distributions of *some* of the fonts that do include international characters, however it appears that they were not in the data that we started with. And some of the symbols, such as the Euro are obviously not in the font data, as that data predates the Euro symbol by quite some time.
We can certainly create new fonts and characters, and there have been other requests to do so. Probably the first step should be to build a modern Hershey font editor– perhaps based in Processing –so that we can begin to add these and other requested font characters.
October 6, 2012 at 1:57 pm #20917daxbotParticipantThanks Windell for the fast reply.
Two follow-on questions:
– any suggestions on how I might get hold of a more complete glyph table?
– … and if I did, would I need to change anything else? From a quick look at the code, it seems that characters outside the range 32 to 127 are being excluded programmatically (lines 72, 84 in hershey.py) – so presumably this would also need adjusting if new glyphs are added ?
All help greatly appreciated!
October 7, 2012 at 1:35 pm #20918Windell OskayKeymasterThe Hershey Fonts are given in a slightly unusual ascii code, based on the distance from the letter “R” in the alphabet. Our extensions use that code, translated slightly into numeric values, with different codes for move and lift (M, L).
See these two references for more about the original formats:
http://emergent.unpythonic.net/software/hershey
http://www.ghostscript.com/doc/current/Hershey.htmYou can certainly change the range of excluded characters as well, to make it accept any value that you like. If you need to type a character that isn’t in the ascii range, you’ll need to improvise somewhat, as the only input presently available is from the keyboard.October 17, 2012 at 8:59 am #20919daxbotParticipantAfter a little fiddling around, I have made a version of the basic Hershy Font (hersheydata.py) with most of the accents (in future light only), and adapted the Hershey Text extension to use it (hershey.py)
I also have adapted the two Eggbot-related extensions that use it, Name Poem and Spiral Text.
If you’d like to have a copy, to make available to other users, please let me know where I can post/send the code…
I may try to add a few other fonts and characters to the family – but no promises as to if/when this will be!
June 24, 2013 at 4:31 am #20920aldobrantiParticipantHi Daxbot can I have a copy of your python code ?
aldoApril 13, 2014 at 8:04 am #20921GiampaoloParticipantHello daxbot, I’ve come across your post only now. Is your code for accents still available? Thank you
G.April 13, 2014 at 10:08 am #20922ragstianParticipantHi.
Getting a reply from “daxbot” is higly unlikely – the stats from the forum states that daxbot’s last visit to this forum was in October 2012.
quote from earlier post in this thread;
We can certainly create new fonts and characters, and there have been
other requests to do so. Probably the first step should be to build a
modern Hershey font editor– perhaps based in Processing –so that we
can begin to add these and other requested font characters.The best bet to get accented characters in the hershey extension would be to have WIndell generate it.
He is the original author of the extensions and have the knowledge and possibly code to “translate” a regular font into the hersheydata.py file needed by the extensions.
Windell – what if we say “Please”? (We can even send you some “Hershey” bars!)
I know that this will be “a project for a rainy day” and as such has got low priority.RGDS
Ragnar -
AuthorPosts
- You must be logged in to reply to this topic.