HN Gopher Feed (2017-08-06) - page 1 of 10 ___________________________________________________________________
Tofu - The opposite of a font
67 points by juanpotato
https://github.com/JuanPotato/Tofu___________________________________________________________________
userbinator - 2 hours ago
WARNING: PLEASE DO NOT RUN THIS CODE ON A HARD DRIVE, I'M NOT SURE
HOW LONG IT WOULD TAKE. I USED A RAM DISKI haven't looked at the
implementation, but this seems to imply it is very I/O intensive
and already takes a very long time in RAM. Yet, nothing about the
problem statement suggests it would be such a task --- it sounds
like something that could be very straightforwardly done completely
in memory.
juanpotato - 1 hours ago
You're right and I should have added more details. fontforge only
accepts file paths and not strings sadly
CJefferson - 2 hours ago
It's just that the python library used won't read SVG from a
string, online from a file given a filename, so each character
must be written to disk, then read back in.
userbinator - 1 hours ago
Wow. To me that's definitely in the realm of "fix this if you
need to run this program more than once" inefficiency. After
looking at the implementation, it doesn't seem like it takes
advantage of TTF's "composite glyphs" feature either, which
would be the most straightforward way of generating a font like
this --- once you define the box and the digit glyphs, each
character is then composed entirely of references to the box
and the appropriate digit glyphs.
juanpotato - 1 hours ago
Yeah I tried looking to see how much I would need to change
to fix it, but I'm not too great in C which is what fontforge
was written in.Oh man I gotta look into the composite glyphs.
I don't know much about fonts in general. Thanks for this bit
of information.
Retr0spectrum - 2 hours ago
> WARNING: PLEASE DO NOT RUN THIS CODE ON A HARD DRIVE, I'M NOT
SURE HOW LONG IT WOULD TAKE. I USED A RAM DISKHow much disk IO does
this program generate? Why?In any case, the OS should cache stuff
and give similar performance to using a ramdisk, provided you have
enough spare ram.
juanpotato - 1 hours ago
Fontforge doesn't have a function for loading svgs as glyphs from
strings. Only files paths.
13of40 - 2 hours ago
> the OS should cache stuffWhen I worked at Microsoft back in the
90's I inquired around building 26 as to why I couldn't create a
ram disk on what was to become Windows 2000, and this was
basically the answer. So yes, if caching doesn't solve this then
caching hasn't been implemented correctly.
mintplant - 3 hours ago
re: license, the SIL Open Font License is common and well-accepted.
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=...
boltn - 2 hours ago
how would one go about running code/operations on ram as opposed to
the hd?
Retr0spectrum - 1 hours ago
On most Linux distros, /tmp is a ramdisk.
JetSpiegel - 1 hours ago
But with only 1 GB capacity
glandium - 12 minutes ago
It depends on your setup. The default when no size is given
is to use half the RAM.
mcpherrinm - 8 minutes ago
I don't think this is nearly universal - certainly none of the
systems I use have /tmp as tmpfs./dev/shm, on the other hand,
is almost always guaranteed to be a tmpfs on glibc systems.
k__ - 1 hours ago
On most operating systems you can use part of your RAM as disk.
Format it like a regular disk, mount it and save files on it.The
data is gone if you restart tho.