Text-mode apps (Was :Who are the "spacists"?)

Mikhail V mikhailwas at gmail.com
Sun Mar 26 19:42:21 EDT 2017


On 26 March 2017 at 21:53, Chris Angelico <rosuav at gmail.com> wrote:
> On Mon, Mar 27, 2017 at 6:25 AM, Mikhail V <mikhailwas at gmail.com> wrote:
>> On 26 March 2017 at 20:10, Steve D'Aprano <steve+python at pearwood.info> wrote:
>>> On Mon, 27 Mar 2017 03:57 am, Mikhail V wrote:
>>>
>>> [...]
>>>>>> And more important: can one use binary (bitmap) fonts in default modern
>>>>>> linux console? If yes, can one patch them with custom tiles at
>>>>>> the application start?
>>>>>
>>>>> If you really need something completely custom, it's not text any
>>>>> more.
>>>>
>>>> Obvious fact, but if I need e.g. rounded corners in table drawing
>>>> characters? Or I just want to fix some characters which look especially
>>>> ugly? Create a new TTF? No, thanks, this would be worst nightmare to
>>>> do without a special tool (which have prices with several zeros, otherwise
>>>> just don't work and can even break things system-wide)
>>>
>>> Don't be silly. It took me ten seconds on Google to find this:
>>>
>>> https://birdfont.org/
>>>
>>
>> It takes you ten seconds to Google, and what if I ask you
>> to take, say Courier New font TTF file (which includes not only
>> vector information but all that is responsible for bitmap
>> rendering, subpixeling, etc), then edit one character (and
>> all corresponding information for subpixeling),
>> then compile it as a new font, then install it on Win,
>> without that making any conflicts, and without _any_
>> further glitches or changes in other characters, and no such
>> things across all applications.
>> If you'd try that, and you will succeed, _then_ I will publicly admit
>> that I was silly.
>>
>> And paying even 50$ for correcting one glyph... well
>> probably I'll do it if one gives guarantee that all above
>> will work.
>
> See previous comments about font substitution. Create a font with just
> one character in it. Use that font in your application. Voila! No
> changes to any other applications (because they'll still be using the
> original font), and no changes to any other characters.

Good tip, I'll try that. Though still one need an app, even
for one character, and it'll need fallback setup on each
computer I use.
Dont get it wrong, I don't say it is impossible. There are
guys that have figured out such things and I've read once
something about hacking bitmap and subpixeling
information directly in the font file, but I was not
stubborn enough to learn that.


> Is it that decades of typographical research is incorrect, or that the
> designers of this font just sucked? You're pretty unambiguous in your
> description that you are "correcting" a glyph. Not adapting it to your
> own purposes - you're correcting something that's fundamentally wrong
> in someone else's font. Impressive.

Call it "modify for own purpose" if it sounds better.
In Courier, the brackets are too small, tilde char is too
much like hyphen, some other minor things.
And Courier New bold is best readable (for me ;) font on Win
 so I don't want another font, which has better brackets,
but less readable. And as said, if possible I avoid
monospaced font where possible, so this means
that probably I'll need to modfy some other fonts too.


>>>> And for own standalone app, I would not use any TTF or
>>>> anything vector-based font, since why?
>>>
>>> Right, because your users will *love* to see their native language displayed
>>> in a crappy bitmapped font with jagged or blurry edges.
>>>
>>
>> I am working on text rendering algorithms an have prototyped
>> several bitmap-based text rendering algorithms,
>> both managed and prerendered approaches, and there
>> is _nothing_ jagged or [incorrectly] blurred there, when
>> one knows what he's doing of course.
>> So it would be _very_ hard to catch me on incompetence
>> here, but you can try, and feel free to do it :))))
>
> Sure. Render me two characters on a half-meter-wide 1920x1080 screen.
> I'll choose the exact size dynamically, at run-time, in response to
> the amount of chrome I have on the window. Make sure the two
> characters look perfect whether I make this a tiny marker on the
> screen, or make it completely fill the entire monitor.
> [...]
> Even if high-DPI displays *do* prevail, you still have to render
> text at a wide variety of pixel sizes.

Seems like you are jumping from one corner case to another.
In general, if you want huge letters or some design tasks
(e.g. huge letters for a print) you can use vector paths.
But remember that a photo or a bitmap texture will not
become new information if you convert each pixel to a vector square, or
circle.  It is only question of scalability.

Concentrate on these points:
- Restrict the case to display only
- Making one letter fill half of a monitor, or rotating it arbitrary,
has little to do with reading text on a monitor in real situation.
- Your understanding of "look perfect" and relation with
information cognition (e.g. a retro game upscaled with
integer scaler versus a remake of this game made completely
with higher resolution sprites - will you say
that the latter feels much better?)
- "Render text at a wide variety of pixel sizes": yes, one
can do this all only with bitmap information, if one uses
appropriate image sources and algorithms. This
gives perfect results. And there are few interesting
solutions for performance optimisations without
breaking the distance precision (e.g. currently
subpixeling on Windows is used, but there are other
good ways without subpixeling)

In real application, you can achieve this with real-time
vector rendering, but it will be simply not worth it, since
you will gain no improvement of reading experience.

So the possibility to render huge letters and then
inspecting the tangents of all curves with a looking
glass will not count as an argument by choice decision for
a reader software for example (for each given task, there is
concrete optimal solution)

And all text I currently read on my monitor are prerendered bitmaps,
refined manually for frequently used sizes, and that is how it
should be made. IOW there are much more important aspects
than the ability to scale a text line from 600 px to 601 px wide, if you
know what I mean.


Mikhail



More information about the Python-list mailing list