PreviousUpNext

15.3.679  src/lib/x-kit/widget/old/fancy/graphviz/font-family-cache.api

## font-family-cache.api
#
# Cache fonts by size for a font family
# specified by a string like
#
#     "-adobe-times-medium-r-normal--%d-*-*-*-p-*-iso8859-1"

# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib

# This api is implemented in:
#     src/lib/x-kit/widget/old/fancy/graphviz/font-family-cache.pkg

stipulate
    package wg =  widget;                       # widget                is from   src/lib/x-kit/widget/old/basic/widget.pkg
    package xc =  xclient;                      # xclient               is from   src/lib/x-kit/xclient/xclient.pkg
herein

    api Font_Family_Cache {

        Font_Family_Cache;

        default_font_family:  String;           # Something like "-adobe-times-medium-r-normal--%d-*-*-*-p-*-iso8859-1".

        # Create a font family cache for given
        # root window (X server) and font family.
        #
        make_font_family_cache
            :
            wg::Root_Window                     # Root window. (Effectively, X server.)
            -> String                           # Font family.  default_font_family or similar.
            -> Font_Family_Cache;

        # Get font of given pointsize from cache,
        # if need be first loading it via X server.
        #
        # If requested pointsize is not available, largest
        # pointsize smaller than requested size will be returned.
        # NULL is returned if there is no such font.
        #
        get_font:   Font_Family_Cache -> Int -> Null_Or( xc::Font );
    };

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext