Skip to content

Commit aa0d27e

Browse files
committed
Expose default_substitute and config_substitute
1 parent 24272e6 commit aa0d27e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

fontconfig/src/lib.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,30 @@ impl<'fc> Pattern<'fc> {
275275
}
276276
}
277277

278-
fn default_substitute(&mut self) {
278+
/// Supplies default values for underspecified font patterns.
279+
///
280+
/// * Patterns without a specified style or weight are set to Medium.
281+
/// * Patterns without a specified style or slant are set to Roman.
282+
/// * Patterns without a specified pixel size are given one computed from any specified point size
283+
/// (default 12), dpi (default 75) and scale (default 1).
284+
///
285+
/// *Note:* [font_match][Self::font_match] and [sort_fonts][Self::sort_fonts] call this so you
286+
/// don't need to manually call it when using those methods.
287+
///
288+
/// [Fontconfig reference](https://www.freedesktop.org/software/fontconfig/fontconfig-devel/fcdefaultsubstitute.html)
289+
pub fn default_substitute(&mut self) {
279290
unsafe {
280291
ffi_dispatch!(LIB, FcDefaultSubstitute, self.pat);
281292
}
282293
}
283294

284-
fn config_substitute(&mut self) {
295+
/// Execute substitutions.
296+
///
297+
/// *Note:* [font_match][Self::font_match] and [sort_fonts][Self::sort_fonts] call this so you
298+
/// don't need to manually call it when using those methods.
299+
///
300+
/// [Fontconfig reference](https://www.freedesktop.org/software/fontconfig/fontconfig-devel/fcconfigsubstitute.html)
301+
pub fn config_substitute(&mut self) {
285302
unsafe {
286303
ffi_dispatch!(
287304
LIB,

0 commit comments

Comments
 (0)