Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #3753
| Date | 2022-02-20 14:11 +1100 |
|---|---|
| Newsgroups | comp.lang.postscript |
| From | David Newall <davidn@davidnewall.com> |
| Subject | Final request for feedback |
| Message-ID | <6211b169$1@news.ausics.net> (permalink) |
| Organization | Ausics - https://www.ausics.net |
Hi All, I'm about to publish my UTF-8 code. Before I do I'm asking for feedback and opinions for what should be the last time. What's different about what I'm finally intending to publish: 1. I'm using a dictionary for the UNICODE encoding map, instead of sparse array. This isn't because it's faster -- 3ns slower seems quite acceptable -- and a dictionary is bigger -- over double the size for GNU's UnifontMedium. I'm doing this because it's two less files to publish -- I don't need to publish sparseget and I don't need to publish an AWK script to convert Fontforge .g2n files into a sparse array. 2. I've replaced utf8show with utf8decode (which generates an array of UNICODE values) and unicodeshow. 3. I'm not storing the map in the font, but passing it as a parameter to unicodeshow because I think it's simpler. Storing it in the font means defining a new font (definefont). These are the alternative programs for printing a UTF-8 string. This is what I think I'll publish: %!PS %%IncludeResource: procset unicodeshow %%IncludeResource: procset utf8decode /Helvetica 20 selectfont 100 300 moveto (Welcome to \342\200\234UTF-8\342\200\235 \342\230\272) utf8decode ReverseAdobeGlyphList exch unicodeshow showpage This is what I was previously intending, using a dictionary: %!PS %%IncludeResource: procset unicodefont %%IncludeResource: procset unicodeshow %%IncludeResource: procset utf8decode /Helvetica findfont 20 scalefont ReverseAdobeGlyphList unicodefont /MyFont exch definefont setfont 100 300 moveto (Welcome to \342\200\234UTF-8\342\200\235 \342\230\272) utf8decode unicodeshow showpage There's one extra line if using a sparse array instead of a dictionary: %%IncludeResource: procset sparseget I think the first is better but am open to opposing opinions. Thanks, David
Back to comp.lang.postscript | Previous | Next — Next in thread | Find similar
Final request for feedback David Newall <davidn@davidnewall.com> - 2022-02-20 14:11 +1100
Re: Final request for feedback luser droog <luser.droog@gmail.com> - 2022-02-22 07:36 -0800
Composite fonts for Unicode strings (was: Final request for feedback) Carlos <carlos@cvkm.cz> - 2022-02-26 01:44 +0100
Re: Composite fonts for Unicode strings (was: Final request for feedback) David Newall <davidn@davidnewall.com> - 2022-02-28 21:39 +1100
Re: Composite fonts for Unicode strings (was: Final request for feedback) David Newall <davidn@davidnewall.com> - 2022-02-28 22:26 +1100
Re: Final request for feedback Carlos <carlos@cvkm.cz> - 2022-02-26 01:56 +0100
csiph-web