[haiku-commits] Re: haiku: hrev52159 - src/servers/app/font docs/interface_guidelines src/kits/network/libnetapi src/servers/app

  • From: Philippe Houdoin <philippe.houdoin@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 3 Aug 2018 10:21:00 +0200

Yeah, forgot my IsPlainFixed() suggestion, IsMonospaced() is a way better
name.

2018-08-03 9:46 GMT+02:00 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:

Am 03/08/2018 um 08:01 schrieb Adrien Destugues:

Now, the problem is that this may break the API, because be_fixed_font
is supposed to be a really fixed font (I'm not even sure about this, I
wanted to check on my BeOS machine to see wether it allows them as
"monospace" but could not get it to boot, yet). So, we need to provide
some way for old apps to do something mostly right.


I must admit that I changed my opinion from 10 years ago that #947 [1]
conserved :-)

So, we can:
- Allow be_fixed_font to actually be a full&half fixed font, and maybe
   deal with graphic glitches in apps which are not aware of it and rely
   on a fixed font, when they try to display the full-width characters.
   Note that such apps were already unable to show Japanese characters
   (as no actually monospace font would properly render both Japanese and
   Latin chars), replacing "tofu" (the missing char box placeholder) with
   a glitchy or misaligned rendering of a character may be an improvement.
- Keep a monospace font for be_fixed_font purpose, but deprecate it.
   Then it would not be user settable, support only a subset of
   characters. We would introduce a be_full_half_fixed_font as a
   replacement.


I think I would prefer bug reports like "App does not support
full-and-half width correctly" than "App ignores systems settings".

The BeBook only specifies that be_fixed_font is:
"The font that's used to display fixed-width characters." [2]

And BFont::IsFixed() is documented as "if the font is fixed" [3], which is
rather vague. Now, the characters of full-and-half-width fonts are fixed,
they just have two fixed sizes :-)

So I'd suggest go with the first option, but:
- Change IsFixed() to return true for full-and-half-fixed, as well
- Introduce a IsMonospaced() that works like IsFixed() now

It's an API reinterpretation, that will definitely break some apps trying
to display those fonts properly. But since it only affects CJK users, and
even improves the situation for them from "not show the characters at all"
to "show them incorrectly", I'd prefer that solution.

There are two possible outcomes in apps:
1. An app computes the size of the string manually, and the actual string
does not fit in the reserved space (it uses the OS to draw the whole
string).
2. An app draws each character by itself, and some characters lay over
each other as a result (or are cut off).

In theory a variety exists where apps would either assume the half or the
full width as general character width, but I guess this won't happen in
practice.

Bye,
   Axel.

[1] https://dev.haiku-os.org/ticket/947#comment:17
[2] https://www.haiku-os.org/legacy-docs/bebook/BFont_Overview.html
[3] https://www.haiku-os.org/legacy-docs/bebook/BFont.html#BFont_IsFixed


Other related posts: