libi3/font: Use "pango:" prefix to avoid confusion
Also add a user-friendly font description syntax to userguide
This commit is contained in:
parent
783fd66b58
commit
f0d2d84b1c
|
@ -316,13 +316,15 @@ and fall back to a working font.
|
|||
*Syntax*:
|
||||
------------------------------
|
||||
font <X core font description>
|
||||
font xft:<a FreeType font description>
|
||||
font pango:[family list] [style options] [size]
|
||||
------------------------------
|
||||
|
||||
*Examples*:
|
||||
--------------------------------------------------------------
|
||||
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
font xft:DejaVu Sans Mono 10
|
||||
font pango:DejaVu Sans Mono 10
|
||||
font pango:DejaVu Sans Mono, Terminus Bold Semi-Condensed 11
|
||||
font pango:Terminus 11x
|
||||
--------------------------------------------------------------
|
||||
|
||||
[[keybindings]]
|
||||
|
@ -1117,7 +1119,7 @@ font <font>
|
|||
--------------------------------------------------------------
|
||||
bar {
|
||||
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
font xft:DejaVu Sans Mono 10
|
||||
font pango:DejaVu Sans Mono 10
|
||||
}
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
|||
# The font above is very space-efficient, that is, it looks good, sharp and
|
||||
# clear in small sizes. However, if you need a lot of unicode glyphs or
|
||||
# right-to-left text rendering, you should instead use pango for rendering and
|
||||
# chose an xft font, such as:
|
||||
# font xft:DejaVu Sans Mono 10
|
||||
# chose a FreeType font, such as:
|
||||
# font pango:DejaVu Sans Mono 10
|
||||
|
||||
# use Mouse+Mod1 to drag floating windows to their wanted position
|
||||
floating_modifier Mod1
|
||||
|
|
|
@ -16,8 +16,8 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
|||
# The font above is very space-efficient, that is, it looks good, sharp and
|
||||
# clear in small sizes. However, if you need a lot of unicode glyphs or
|
||||
# right-to-left text rendering, you should instead use pango for rendering and
|
||||
# chose an xft font, such as:
|
||||
# font xft:DejaVu Sans Mono 10
|
||||
# chose a FreeType font, such as:
|
||||
# font pango:DejaVu Sans Mono 10
|
||||
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
|
|
@ -142,7 +142,11 @@ i3Font load_font(const char *pattern, const bool fallback) {
|
|||
|
||||
#if PANGO_SUPPORT
|
||||
/* Try to load a pango font if specified */
|
||||
if (strlen(pattern) > strlen("xft:") && !strncmp(pattern, "xft:", strlen("xft:"))) {
|
||||
if (strlen(pattern) > strlen("pango:") && !strncmp(pattern, "pango:", strlen("pango:"))) {
|
||||
pattern += strlen("pango:");
|
||||
if (load_pango_font(&font, pattern))
|
||||
return font;
|
||||
} else if (strlen(pattern) > strlen("xft:") && !strncmp(pattern, "xft:", strlen("xft:"))) {
|
||||
pattern += strlen("xft:");
|
||||
if (load_pango_font(&font, pattern))
|
||||
return font;
|
||||
|
|
Loading…
Reference in New Issue