InputTemplate

Struct InputTemplate 

Source
pub struct InputTemplate {
Show 19 fields pub input: Vec<u8>, pub out_dir: Option<String>, pub css: Option<CssProperties>, pub target_type: Option<String>, pub subsets: Vec<Vec<u8>>, pub chunk_size: Option<i32>, pub chunk_size_tolerance: Option<f32>, pub max_allow_subsets_count: Option<i32>, pub test_html: Option<bool>, pub reporter: Option<bool>, pub preview_image: Option<PreviewImage>, pub rename_output_font: Option<String>, pub build_mode: Option<String>, pub language_areas: Option<bool>, pub multi_threads: Option<bool>, pub font_feature: Option<bool>, pub reduce_mins: Option<bool>, pub auto_subset: Option<bool>, pub subset_remain_chars: Option<bool>,
}

Fields§

§input: Vec<u8>

ttf 文件的 buffer

§out_dir: Option<String>

切割后放置文件的文件夹

§css: Option<CssProperties>

CSS 配置

§target_type: Option<String>

目标类型

§subsets: Vec<Vec<u8>>

子集

§chunk_size: Option<i32>

包大小

§chunk_size_tolerance: Option<f32>

包大小容差

§max_allow_subsets_count: Option<i32>

最大允许子集数量

§test_html: Option<bool>

是否生成测试 HTML

§reporter: Option<bool>

是否生成 reporter.bin

§preview_image: Option<PreviewImage>

预览图像

§rename_output_font: Option<String>

重命名输出字体

§build_mode: Option<String>

TODO 构建模式

§language_areas: Option<bool>

是否进行语言区域优化

§multi_threads: Option<bool>

TODO 是否使用多线程

§font_feature: Option<bool>

是否启用字体特性

§reduce_mins: Option<bool>

TODO 是否减少最小分包,

§auto_subset: Option<bool>

是否自动子集化

§subset_remain_chars: Option<bool>

是否自动添加没有声明的字符

Implementations§

Source§

impl InputTemplate

Source

pub fn out_dir(&self) -> &str

Returns the value of out_dir, or the default value if out_dir is unset.

Source

pub fn target_type(&self) -> &str

Returns the value of target_type, or the default value if target_type is unset.

Source

pub fn language_areas(&self) -> bool

Returns the value of language_areas, or the default value if language_areas is unset.

Source

pub fn chunk_size(&self) -> i32

Returns the value of chunk_size, or the default value if chunk_size is unset.

Source

pub fn chunk_size_tolerance(&self) -> f32

Returns the value of chunk_size_tolerance, or the default value if chunk_size_tolerance is unset.

Source

pub fn max_allow_subsets_count(&self) -> i32

Returns the value of max_allow_subsets_count, or the default value if max_allow_subsets_count is unset.

Source

pub fn test_html(&self) -> bool

Returns the value of test_html, or the default value if test_html is unset.

Source

pub fn reporter(&self) -> bool

Returns the value of reporter, or the default value if reporter is unset.

Source

pub fn rename_output_font(&self) -> &str

Returns the value of rename_output_font, or the default value if rename_output_font is unset.

Source

pub fn build_mode(&self) -> &str

Returns the value of build_mode, or the default value if build_mode is unset.

Source

pub fn multi_threads(&self) -> bool

Returns the value of multi_threads, or the default value if multi_threads is unset.

Source

pub fn font_feature(&self) -> bool

Returns the value of font_feature, or the default value if font_feature is unset.

Source

pub fn reduce_mins(&self) -> bool

Returns the value of reduce_mins, or the default value if reduce_mins is unset.

Source

pub fn auto_subset(&self) -> bool

Returns the value of auto_subset, or the default value if auto_subset is unset.

Source

pub fn subset_remain_chars(&self) -> bool

Returns the value of subset_remain_chars, or the default value if subset_remain_chars is unset.

Trait Implementations§

Source§

impl Clone for InputTemplate

Source§

fn clone(&self) -> InputTemplate

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InputTemplate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InputTemplate

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for InputTemplate

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for InputTemplate

Source§

fn eq(&self, other: &InputTemplate) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for InputTemplate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.