Thanks.  I knew about the font tables, but I don't think I updated and saved
properly the first time.  Fixedsys is a favorite heavy monospaced font.
With the Fixedsys, I've tried factors of 1.5 and 2.  The first produces a
very small, marginally acceptable look.  The second produces a huge font,
about a factor of 4 to 5 change in height.  There is no in-between with the
truncation.  This doesn't seem correct.  I've been able to adjust this
raster font more finely on other occasions.

 

 

Shaping

 

 

 

 

There isn't a clean API to change the font or styles of the listener.
However, on Windows you can hack basis/windows/fonts/fonts.factor to do so.
In fonts.factor there are two definitions "windows-fonts" and
"(cache-fonts)". "windows-fonts" looks like this:

 

MEMO: windows-fonts ( -- fonts )

    windows-major 6 >=

    H{

        { "sans-serif" "Segoe UI" }

        { "serif" "Cambria" }

        { "monospace" "Consolas" }

    }

    H{

        { "sans-serif" "Tahoma" }

        { "serif" "Times New Roman" }

        { "monospace" "Courier New" }

    } ? ;

 

This sets the mapping of the default Factor sans serif/serif/monospace font
families to Windows font family names. The first set is used on Windows
Vista or 7, and the second on XP. You can change these to whatever you
prefer. The listener uses the "monospace" font mapping while the docs
browser uses the "sans-serif" mapping.

 

To change the size of fonts, look at "(cache-font)":

 

MEMO:: (cache-font) ( font -- HFONT )

    font size>> neg ! nHeight

    0 0 0 ! nWidth, nEscapement, nOrientation

    font bold?>> FW_BOLD FW_NORMAL ? ! fnWeight

    font italic?>> TRUE FALSE ? ! fdwItalic

    FALSE ! fdwUnderline

    FALSE ! fdWStrikeOut

    DEFAULT_CHARSET ! fdwCharSet

    OUT_OUTLINE_PRECIS ! fdwOutputPrecision

    CLIP_DEFAULT_PRECIS ! fdwClipPrecision

    DEFAULT_QUALITY ! fdwQuality

    DEFAULT_PITCH ! fdwPitchAndFamily

    font name>> windows-font-name

    CreateFont

    dup win32-error=0/f ;

 

Note the reference to "font size>>" at the very beginning. You can globally
scale the font sizes used in the UI by applying a multiplier to this value,
for example:

 

MEMO:: (cache-font) ( font -- HFONT )

    font size>> 1.5 * >integer neg ! nHeight

    0 0 0 ! nWidth, nEscapement, nOrientation

    font bold?>> FW_BOLD FW_NORMAL ? ! fnWeight

    font italic?>> TRUE FALSE ? ! fdwItalic

    FALSE ! fdwUnderline

    FALSE ! fdWStrikeOut

    DEFAULT_CHARSET ! fdwCharSet

    OUT_OUTLINE_PRECIS ! fdwOutputPrecision

    CLIP_DEFAULT_PRECIS ! fdwClipPrecision

    DEFAULT_QUALITY ! fdwQuality

    DEFAULT_PITCH ! fdwPitchAndFamily

    font name>> windows-font-name

    CreateFont

    dup win32-error=0/f ;

 

(The ">integer" is necessary because "CreateFont" expects an integer
height.) Once you've made these changes, press F2 in the listener, type
"save" to commit your changes to the Factor image, and quit and restart the
listener. You should see your font changes take effect after restarting.

 

-Joe

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to