1. Yad Font

Display font selection dialog

yad --font
yad font
Figure 1. Font dialog
Output in the terminal
Sans 10
If you were to select the Bold Style the output looks like
Sans Bold 10

1.1. --fontname=FONTNAME

Set the initial font.
FONTNAME is a string with font representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]".

1.2. --preview=TEXT

Set text string for preview.

yad --preview="This is the preview text"
yad font preview
Figure 2. Font dialog with a custom preview

1.3. --separate-output

Separate output of font description.

yad --font --separate-output
The result output is
Sans|Bold Italic|10

1.4. --separator=STRING

Set output separator character.
Default separator is |.

1.5. --quoted-output

Output data will be in shell-style quotes.

yad --font --quoted-output
yad font quoted output
Figure 3. Font dialog with qouted output
The result output is
'Sans Bold Italic 10'

1.6. Tips

To pass the three, (Family, Style, Size) separately, you need to do something like this:

yad --font | while read line; do
	# Might need to add more styles.
	STL=$(echo $line | grep -o "Bold\|Italic\|Oblique\|Condensed\|Medium")
	STYLE=$(echo $STL)
	SIZE=$(echo $line | awk '{print $NF}')

	if [ "$STYLE" = "" ]; then
		NAME=`echo $line | awk -F"$SIZE" '{print $1}'`
		NAME=`echo $line | awk -F"$STYLE" '{print $1}'`

	echo $NAME
	echo $STYLE
	echo $SIZE


Back to YAD Guide