aboutsummaryrefslogtreecommitdiff
path: root/font/src/ft/fc
diff options
context:
space:
mode:
Diffstat (limited to 'font/src/ft/fc')
-rw-r--r--font/src/ft/fc/char_set.rs2
-rw-r--r--font/src/ft/fc/config.rs2
-rw-r--r--font/src/ft/fc/font_set.rs4
-rw-r--r--font/src/ft/fc/mod.rs12
-rw-r--r--font/src/ft/fc/pattern.rs34
5 files changed, 27 insertions, 27 deletions
diff --git a/font/src/ft/fc/char_set.rs b/font/src/ft/fc/char_set.rs
index 4bba4818..a60513c2 100644
--- a/font/src/ft/fc/char_set.rs
+++ b/font/src/ft/fc/char_set.rs
@@ -70,7 +70,7 @@ impl CharSetRef {
pub fn merge(&self, other: &CharSetRef) -> Result<bool, ()> {
unsafe {
- // Value is just an indicator whether something was added or not
+ // Value is just an indicator whether something was added or not.
let mut value: FcBool = 0;
let res = FcCharSetMerge(self.as_ptr() as _, other.as_ptr() as _, &mut value);
if res == 0 {
diff --git a/font/src/ft/fc/config.rs b/font/src/ft/fc/config.rs
index 44bb9986..868d2c42 100644
--- a/font/src/ft/fc/config.rs
+++ b/font/src/ft/fc/config.rs
@@ -24,7 +24,7 @@ foreign_type! {
}
impl Config {
- /// Get the current configuration
+ /// Get the current configuration.
pub fn get_current() -> &'static ConfigRef {
unsafe { ConfigRef::from_ptr(FcConfigGetCurrent()) }
}
diff --git a/font/src/ft/fc/font_set.rs b/font/src/ft/fc/font_set.rs
index ae746f45..241ee344 100644
--- a/font/src/ft/fc/font_set.rs
+++ b/font/src/ft/fc/font_set.rs
@@ -39,7 +39,7 @@ impl FontSet {
FcFontSetList(
config.as_ptr(),
&mut source.as_ptr(),
- 1, // nsets
+ 1, // nsets.
pattern.as_ptr(),
objects.as_ptr(),
)
@@ -48,7 +48,7 @@ impl FontSet {
}
}
-/// Iterator over a font set
+/// Iterator over a font set.
pub struct Iter<'a> {
font_set: &'a FontSetRef,
num_fonts: usize,
diff --git a/font/src/ft/fc/mod.rs b/font/src/ft/fc/mod.rs
index ecb056f7..b1b66be6 100644
--- a/font/src/ft/fc/mod.rs
+++ b/font/src/ft/fc/mod.rs
@@ -72,7 +72,7 @@ pub fn font_sort(config: &ConfigRef, pattern: &PatternRef) -> Option<FontSet> {
let ptr = FcFontSort(
config.as_ptr(),
pattern.as_ptr(),
- 1, // Trim font list
+ 1, // Trim font list.
&mut charsets,
&mut result,
);
@@ -102,14 +102,14 @@ pub fn font_list(
}
}
-/// Available font sets
+/// Available font sets.
#[derive(Debug, Copy, Clone)]
pub enum SetName {
System = FcSetSystem as isize,
Application = FcSetApplication as isize,
}
-/// When matching, how to match
+/// When matching, how to match.
#[derive(Debug, Copy, Clone)]
pub enum MatchKind {
Font = FcMatchFont as isize,
@@ -187,7 +187,7 @@ impl From<isize> for Width {
}
}
-/// Subpixel geometry
+/// Subpixel geometry.
#[derive(Debug)]
pub enum Rgba {
Unknown,
@@ -237,7 +237,7 @@ impl From<isize> for Rgba {
}
}
-/// Hinting Style
+/// Hinting Style.
#[derive(Debug, Copy, Clone)]
pub enum HintStyle {
None,
@@ -257,7 +257,7 @@ impl fmt::Display for HintStyle {
}
}
-/// Lcd filter, used to reduce color fringing with subpixel rendering
+/// Lcd filter, used to reduce color fringing with subpixel rendering.
pub enum LcdFilter {
None,
Default,
diff --git a/font/src/ft/fc/pattern.rs b/font/src/ft/fc/pattern.rs
index 53641f67..f40cc9c9 100644
--- a/font/src/ft/fc/pattern.rs
+++ b/font/src/ft/fc/pattern.rs
@@ -54,7 +54,7 @@ impl<'a> StringPropertyIter<'a> {
};
if result == FcResultMatch {
- // Transmute here is to extend lifetime of the str to that of the iterator
+ // Transmute here is to extend lifetime of the str to that of the iterator.
//
// Potential unsafety? What happens if the pattern is modified while this ptr is
// borrowed out?
@@ -67,7 +67,7 @@ impl<'a> StringPropertyIter<'a> {
}
}
-/// Iterator over integer properties
+/// Iterator over integer properties.
pub struct BooleanPropertyIter<'a> {
pattern: &'a PatternRef,
object: &'a [u8],
@@ -99,7 +99,7 @@ impl<'a> BooleanPropertyIter<'a> {
}
}
-/// Iterator over integer properties
+/// Iterator over integer properties.
pub struct IntPropertyIter<'a> {
pattern: &'a PatternRef,
object: &'a [u8],
@@ -204,7 +204,7 @@ impl<'a> LcdFilterPropertyIter<'a> {
}
}
-/// Iterator over integer properties
+/// Iterator over integer properties.
pub struct DoublePropertyIter<'a> {
pattern: &'a PatternRef,
object: &'a [u8],
@@ -236,7 +236,7 @@ impl<'a> DoublePropertyIter<'a> {
}
}
-/// Implement debug for a property iterator
+/// Implement debug for a property iterator.
macro_rules! impl_property_iter_debug {
($iter:ty => $item:ty) => {
impl<'a> fmt::Debug for $iter {
@@ -260,7 +260,7 @@ macro_rules! impl_property_iter_debug {
};
}
-/// Implement Iterator and Debug for a property iterator
+/// Implement Iterator and Debug for a property iterator.
macro_rules! impl_property_iter {
($($iter:ty => $item:ty),*) => {
$(
@@ -310,7 +310,7 @@ macro_rules! impl_derived_property_iter {
}
}
-// Basic Iterators
+// Basic Iterators.
impl_property_iter! {
StringPropertyIter<'a> => &'a str,
IntPropertyIter<'a> => isize,
@@ -318,7 +318,7 @@ impl_property_iter! {
BooleanPropertyIter<'a> => bool
}
-// Derived Iterators
+// Derived Iterators.
impl_derived_property_iter! {
RgbaPropertyIter<'a> => Rgba,
HintStylePropertyIter<'a> => HintStyle,
@@ -460,23 +460,23 @@ impl PatternRef {
index() => b"index\0"
}
- // Prints the pattern to stdout
- //
- // FontConfig doesn't expose a way to iterate over all members of a pattern;
- // instead, we just defer to FcPatternPrint. Otherwise, this could have been
- // a `fmt::Debug` impl.
+ /// Prints the pattern to stdout.
+ ///
+ /// FontConfig doesn't expose a way to iterate over all members of a pattern;
+ /// instead, we just defer to FcPatternPrint. Otherwise, this could have been
+ /// a `fmt::Debug` impl.
pub fn print(&self) {
unsafe { FcPatternPrint(self.as_ptr()) }
}
- /// Add a string value to the pattern
+ /// Add a string value to the pattern.
///
/// If the returned value is `true`, the value is added at the end of
/// any existing list, otherwise it is inserted at the beginning.
///
/// # Unsafety
///
- /// `object` is not checked to be a valid null-terminated string
+ /// `object` is not checked to be a valid null-terminated string.
unsafe fn add_string(&mut self, object: &[u8], value: &str) -> bool {
let value = CString::new(&value[..]).unwrap();
let value = value.as_ptr();
@@ -556,9 +556,9 @@ impl PatternRef {
unsafe { PatternHash(FcPatternHash(self.as_ptr())) }
}
- /// Add charset to the pattern
+ /// Add charset to the pattern.
///
- /// The referenced charset is copied by fontconfig internally using
+ /// The referenced charset is copied by Fontconfig internally using
/// FcValueSave so that no references to application provided memory are
/// retained. That is, the CharSet can be safely dropped immediately
/// after being added to the pattern.