Advertisement
devinteske

Use an alternate font with GTK3 app Zenity

Aug 24th, 2015
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. #!/bin/sh
  2. MONOTEST="\n\n1. --- www [[[ ... %%%\n2. www [[[ %%% ... ---\n"
  3.  
  4. # Normal font
  5. zenity --info --text="This is NOT monospace$MONOTEST"
  6.  
  7. # Alternate font
  8. FONT="DejaVu Sans Mono"
  9. exec 2<<-EOF
  10.         <?xml version="1.0"?>
  11.         <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  12.         <fontconfig>
  13.                 <dir>/usr/local/share/fonts</dir>
  14.                 <dir>/usr/local/lib/X11/fonts</dir>
  15.                 <cachedir>/var/db/fontconfig</cachedir>
  16.                 <match target="pattern">
  17.                         <edit name="family" mode="assign" binding="same">
  18.                                 <string>$FONT</string>
  19.                         </edit>
  20.                 </match>
  21.         </fontconfig>
  22. EOF
  23. FONTCONFIG_FILE=/dev/stderr \
  24.         zenity --info --text="This is monospace$MONOTEST"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement