Remove 'get_*' on getters as per RFC 0344 on various components

This commit is contained in:
Mathieu Rheaume 2015-09-07 22:25:09 -04:00
parent 2733060564
commit 7320433cca
30 changed files with 167 additions and 168 deletions

View file

@ -263,7 +263,7 @@ impl FontHandleMethods for FontHandle {
return metrics;
}
fn get_table_for_tag(&self, tag: FontTableTag) -> Option<Box<FontTable>> {
fn table_for_tag(&self, tag: FontTableTag) -> Option<Box<FontTable>> {
let tag = tag as FT_ULong;
unsafe {

View file

@ -27,7 +27,7 @@ static FC_FILE: &'static [u8] = b"file\0";
static FC_INDEX: &'static [u8] = b"index\0";
static FC_FONTFORMAT: &'static [u8] = b"fontformat\0";
pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) {
pub fn for_each_available_family<F>(mut callback: F) where F: FnMut(String) {
unsafe {
let config = FcConfigGetCurrent();
let fontSet = FcConfigGetFonts(config, FcSetSystem);
@ -57,7 +57,7 @@ pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) {
}
}
pub fn get_variations_for_family<F>(family_name: &str, mut callback: F)
pub fn for_each_variation<F>(family_name: &str, mut callback: F)
where F: FnMut(String)
{
debug!("getting variations for {}", family_name);
@ -111,7 +111,7 @@ pub fn get_variations_for_family<F>(family_name: &str, mut callback: F)
}
}
pub fn get_system_default_family(generic_name: &str) -> Option<String> {
pub fn system_default_family(generic_name: &str) -> Option<String> {
let generic_name_c = CString::new(generic_name).unwrap();
let generic_name_ptr = generic_name_c.as_ptr();
@ -140,7 +140,7 @@ pub fn get_system_default_family(generic_name: &str) -> Option<String> {
}
#[cfg(target_os = "linux")]
pub fn get_last_resort_font_families() -> Vec<String> {
pub fn last_resort_font_families() -> Vec<String> {
vec!(
"Fira Sans".to_owned(),
"DejaVu Sans".to_owned(),
@ -149,6 +149,6 @@ pub fn get_last_resort_font_families() -> Vec<String> {
}
#[cfg(target_os = "android")]
pub fn get_last_resort_font_families() -> Vec<String> {
pub fn last_resort_font_families() -> Vec<String> {
vec!("Roboto".to_owned())
}

View file

@ -192,7 +192,7 @@ impl FontHandleMethods for FontHandle {
return metrics;
}
fn get_table_for_tag(&self, tag: FontTableTag) -> Option<Box<FontTable>> {
fn table_for_tag(&self, tag: FontTableTag) -> Option<Box<FontTable>> {
let result: Option<CFData> = self.ctfont.get_font_table(tag);
result.and_then(|data| {
Some(box FontTable::wrap(data))

View file

@ -10,7 +10,7 @@ use core_text::font_descriptor::{CTFontDescriptor, CTFontDescriptorRef};
use std::borrow::ToOwned;
use std::mem;
pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) {
pub fn for_each_available_family<F>(mut callback: F) where F: FnMut(String) {
let family_names = core_text::font_collection::get_family_names();
for strref in family_names.iter() {
let family_name_ref: CFStringRef = unsafe { mem::transmute(strref) };
@ -20,7 +20,7 @@ pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) {
}
}
pub fn get_variations_for_family<F>(family_name: &str, mut callback: F) where F: FnMut(String) {
pub fn for_each_variation<F>(family_name: &str, mut callback: F) where F: FnMut(String) {
debug!("Looking for faces of family: {}", family_name);
let family_collection = core_text::font_collection::create_for_family(family_name);
@ -35,10 +35,10 @@ pub fn get_variations_for_family<F>(family_name: &str, mut callback: F) where F:
}
}
pub fn get_system_default_family(_generic_name: &str) -> Option<String> {
pub fn system_default_family(_generic_name: &str) -> Option<String> {
None
}
pub fn get_last_resort_font_families() -> Vec<String> {
pub fn last_resort_font_families() -> Vec<String> {
vec!("Arial Unicode MS".to_owned(), "Arial".to_owned())
}