Live data from Hacker News

Tofu – The opposite of a font

github.com

51–60 of 66 posts

Re: Tofu – The opposite of a font

#52

Earlier quoted context omitted.

Half? That seems kind of excessive. Are you sure that’s right?

I would guess that it’s given that capacity, but the memory is allocated lazily.

Correct; tmpfs only uses as much memory as as is used by the files it contains.

Re: Tofu – The opposite of a font

#53

WARNING: PLEASE DO NOT RUN THIS CODE ON A HARD DRIVE, I'M NOT SURE HOW LONG IT WOULD TAKE. I USED A RAM DISK I 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.

You're right and I should have added more details. fontforge only accepts file paths and not strings sadly

[deleted]

Re: Tofu – The opposite of a font

#54

WARNING: PLEASE DO NOT RUN THIS CODE ON A HARD DRIVE, I'M NOT SURE HOW LONG IT WOULD TAKE. I USED A RAM DISK I 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.

You're right and I should have added more details. fontforge only accepts file paths and not strings sadly

Libraries to treat strings as files are pretty common, in python they have one in the std:

https://docs.python.org/2/library/stringio.html

Re: Tofu – The opposite of a font

#55

Earlier quoted context omitted.

What if you're using a program that fsyncs? And the filesystem isn't just keeping writes cached and flushing only when full. So if I'm writing GB of temp files, I'm causing tons of disk load which may impact other programs. Can't seek to read while writing all my temp data...

> What if you're using a program that fsyncs? Remove the fsync or use libeatmydata. > So if I'm writing GB of temp files The kind that won't fit on a ramdisk in the first place? And this particular use case shouldn't need that.

The scenario is I'm running a DB on the same system as temp program. Also, machines with many GB of ram are popular these days.

Re: Tofu – The opposite of a font

#57

Earlier quoted context omitted.

You're right and I should have added more details. fontforge only accepts file paths and not strings sadly

Libraries to treat strings as files are pretty common, in python they have one in the std: https://docs.python.org/2/library/stringio.html

But that's a file, it accepts a file path. I already looked into this

Re: Tofu – The opposite of a font

#58

"This is stupid. Yeah probably, but for its very specific use case it's not terribly bad." Don't put your work down like this. You created something useful for yourself, and likely useful for others. I'd be surprised if someone called it stupid.

Lol it was a joke. Thanks for the support man!

Re: Tofu – The opposite of a font

#59

very nice! this should be the default binary view on many, many things, especially debuggers/inspectors. how does it handle combining characters? do they get everything in a single box or are going to be rendered as two boxes?

They _should_ be treated as two separate boxes as I made it so that each glyph is certain to be full width regardless of the default.

Re: Tofu – The opposite of a font

#60
post #37

Does anyone know the name of the app that's listing/displaying fonts? It looks pretty neat, and I haven't found anything good-looking like that for Linux/*nix.

It's GNOME's font manager: https://fontmanager.github.io/ If you're using ubuntu, there's a package for it

yep
Post reply on HN