Menu

#69 dosemu.conf - better X font setting description

open
nobody
None
5
2012-11-02
2007-06-03
franta
No

After some playing with dosemu (up to 1.4.0 svn 1824)
X fonts I submit this little patch for "dosemu.conf"
for better explanation of "$_X_font" setting - but I'm
no font guru, so this may be not accurate.

(I wanted sent patch for dosemu wrapper too, but svn1824 patch solution is much better)

I think dosemu docs should be updated too, as font
setting and dosemu font behavior are very little
documented. Unfortunately my english is so much bad,
so I can't do it.

And one confusing (for me) thing from dosemu sources
is about bitmap fonts - it seems that
"use_bitmap_font" variable, which control many not
only font processing is set only when font isn't
specified and thus is used built-in.
If "$_X_font" is specified, no matter when
bitmap, scalable or CharCell, "use_bitmap_font" is
set (src/plugin/X/X_font.c) to false.
I walked into this when interested about dosemu window
resizing possibility - and findings that is possible
only when use_bitmap_font = true (otherwise is window
locked in "lock_window_size" X.c func).

I Without detailed knowledge of dosemu X font
processing tried hard set in X_font.c use_bitmap_font
to true (in place "use_bitmap_font = (font == NULL);"
and xdosemu then allowed resize his window no matter
when $_X_font I set was bitmap or scalable or
charcell. Also switch to EGA 43 lines mode work.
Maybe this mean, after success XLoadQueryFont call
isn't any difference between bitmap and scalable font
types?

(I must notify this hard setting "use_bitmap_font"
isn't correct, because although it seemed dosemu work
OK, after exitemu command it crashes on
"cpu exception in dosemu code outside of VM86()!"
error)

Regards, Franta Hanzlik

Discussion

  • franta

    franta - 2007-06-03

    dosemu.conf - better X font setting description

     
  • Bart Oldeman

    Bart Oldeman - 2007-06-05

    Logged In: YES
    user_id=176505
    Originator: NO

    The handling of the built-in bitmap font is really quite different than of X fonts.

    Bitmap fonts are defined by data in VGA memory; then DOSEMU plots them in a 256-color bitmap (1 byte per pixel), which is scaled & transformed into an X bitmap and then put on the display using XPutImage (or XShmPutImage). This means that DOS apps can change this font, it's like a real VGA display.

    With X fonts it's a lot less flexible. The font is loaded using XLoadQueryFont; the rendering is done server side because the X client uses XDrawImageString.

    If you simply use use_bitmap_font = 1; //instead of (font == NULL); the X font will be ignored! It'll be just like $_Xfont="".
    The non-vga fonts are traditionally not so useful because they miss line-drawing characters etc.
    However dosemu 1.4.0 works fine and correct with unicode fonts which contain those, still without scaling or DOS redefinitions.
    e.g.
    -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1

    About the scalable X fonts... I think DOSEMU could scale them when the window is resized but it would need to be programmed to explicitly reload the font when the window is resized. Not so trivial but you could give it a try. Xft seems to be another approach that could be used.

     
  • franta

    franta - 2007-06-07

    Logged In: YES
    user_id=1785897
    Originator: YES

    Ah, when I understand now, right order is start with internal font and then
    eventually change it via standard DOS methods eg. DISPLAY/MODE.
    But in this case fonts looks (mainly on hires LCD displays) bit ugly
    and not optimal for long work. To this time I solved it by extracting
    desired font (eg cp850) from some bitmap unicode X fonts and then set
    it in "$_X_font =". (Is also possible generate bitmap font from scalable,
    I not tried it). But it's cumbersome, mainly when need work on more
    stations with different resolutions. Now it is nice discovery, that may
    be done by selecting scalable X font and setting its POINT_SIZE etc.
    in dosemu.conf "$_X_font =" for optimal DOSEMU window size.
    Then window resizing requests aren't so important.
    I thing this possibility should be mentioned somewhere in doc or
    (as in my patch) in dosemu.conf file.

    And You are right, with "use_bitmap_font = 1" fixed setting, isn't
    selected "$_X_font =" dosemu.conf listed font, but internal bitmap one.

    Franta Hanzlik

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.