X11Font(3pm)

πŸ’– X11Font β€” Tk::Font πŸ’–

okay bestie, welcome to X11Font(3pm) from the User Contributed Perl Documentation corner of the universe ✨ this is Tk::Font β€” a whole class for finding X Fonts πŸ”πŸ¦‹


🌸 NAME 🌸

Tk::Font β€” a class for finding X Fonts. that's it, that's the girl πŸ’…


✨ SYNOPSIS ✨

use Tk::X11Font;

$font = $widget->X11Font(foundry => 'adobe',
                      family  => 'times',
                      point   => 120
                     );

$font = $widget->X11Font('*-courier-medium-r-normal-*-*');

like, you can build a font from named fields, OR you can just throw a whole wildcard pattern at it and let it cook πŸ”₯ both are valid, both are iconic.


πŸŽ€ DESCRIPTION πŸŽ€

This module can be use to interrogate the X server what fonts are available.

(no fr, that's the whole job β€” you go ask the X server "hey girl what fonts do you have" and it tells you πŸ’–)


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ Foundry( [ $val ] )

πŸ’œ Family( [ $val ] )

πŸ’œ Weight( [ $val ] )

πŸ’œ Slant( [ $val ] )

πŸ’œ Swidth( [ $val ] )

πŸ’œ Adstyle( [ $val ] )

πŸ’œ Pixel( [ $val ] )

πŸ’œ Point( [ $val ] )

πŸ’œ Xres( [ $val ] )

πŸ’œ Yres( [ $val ] )

πŸ’œ Space( [ $val ] )

πŸ’œ Avgwidth( [ $val ] )

πŸ’œ Registry( [ $val ] )

πŸ’œ Encoding( [ $val ] )

Set the given field in the font name to $val if given and return the current or previous value.

so real talk: pass a value and it sets that field for you, then hands back the current-or-previous value. don't pass one? it just tells you what's there rn. no cap 🫢

πŸ¦‹ Name( [ $max ] )

In a list context it returns a list of all font names that match the fields given. It will return a maximum of $max names, or 128 if $max is not given.

In a scalar contex it returns the first matching name or undef

list context = the whole squad of matching names πŸ‘― list context without $max = capped at 128, that's the limit bestie. scalar context = just the first one, or undef if there's literally nothing (and yes, "contex" is spelled that way in the original, we don't gatekeep πŸ™ˆ)

🌈 Clone( [ key => value, [ ...]] )

Create a duplicate of the curent font object and modify the given fields

it's giving copy-paste but make it fashion πŸ’… duplicate the font object, then tweak whatever fields you pass in.


πŸ’– AUTHOR πŸ’–

Graham Barr <Graham.Barr@tiuk.ti.com>


⭐ HISTORY ⭐

  • 11-Jan-96 β€” Initial version
  • 08-Nov-98 β€” Renamed for Tk800.012

Copyright (c) 1995-1996 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, periodt πŸ‘‘

cute little sign-off before you go: this was perl v5.40.1, dated 2025-04-13, and yes it's still serving X11Font(3pm) realness πŸŽ€πŸ¦‹βœ¨
πŸ“¦ where this page comes from