Skip to content

Commit 805b8cb

Browse files
committed
more docstring
1 parent b20bc6b commit 805b8cb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/findfonts.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,29 @@ Match a font using the user-specified search string, by increasing the score
4444
for each part that appears in the font family + style name, and decreasing it
4545
for each part that doesn't. The function also prefers shorter font names when
4646
encountering similar scores.
47+
48+
49+
Example:
50+
51+
If we had only four fonts:
52+
- Helvetica
53+
- Helvetica Neue
54+
- Helvetica Neue Light
55+
- Times New Roman
56+
57+
Then this is how this function would match different search strings:
58+
- "helvetica" => Helvetica
59+
- "helv" => Helvetica
60+
- "HeLvEtIcA" => Helvetica
61+
- "helvetica neue" => Helvetica Neue
62+
- "tica eue" => Helvetica Neue
63+
- "helvetica light" => Helvetica Neue Light
64+
- "light" => Helvetica Neue Light
65+
- "helvetica bold" => Helvetica
66+
- "helvetica neue bold" => Helvetica Neue
67+
- "times" => Times New Roman
68+
- "times new roman" => Times New Roman
69+
- "arial" => no match
4770
"""
4871
function match_font(face::FTFont, searchstring)
4972
fname = family_name(face)

0 commit comments

Comments
 (0)