Hersheytext and Accents

Home Evil Mad Scientist Forums Egg-Bot Hersheytext and Accents

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #20114
    daxbot
    Participant

    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” ?

    #20916
    Windell Oskay
    Keymaster

    First 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.

    #20917
    daxbot
    Participant

    Thanks 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!

     

     

    #20918
    Windell Oskay
    Keymaster

    The 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.htm

    You 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.
    #20919
    daxbot
    Participant

    After 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!

    #20920
    aldobranti
    Participant

    Hi Daxbot can I have a copy of your python code ?

    aldo
    #20921
    Giampaolo
    Participant

    Hello daxbot, I’ve come across your post only now. Is your code for accents still available? Thank you
    G.

    #20922
    ragstian
    Participant

    Hi.

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.