Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stb_truetype-rs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
icefoxen
stb_truetype-rs
Commits
85fe6d38
Commit
85fe6d38
authored
Dec 25, 2018
by
icefoxen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a bunch of useful derives.
parent
4e5720e5
Pipeline
#2315
failed with stages
in 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Cargo.toml
Cargo.toml
+1
-1
lib.rs
src/lib.rs
+7
-7
No files found.
Cargo.toml
View file @
85fe6d38
...
...
@@ -12,7 +12,7 @@ keywords = ["font", "truetype", "opentype", "ttf", "otf"]
exclude
=
["/fonts/**"]
[dependencies]
byteorder
=
"1
.0
"
byteorder
=
"1"
[dev-dependencies]
approx
=
{
version
=
"0.3"
,
default-features
=
false
}
src/lib.rs
View file @
85fe6d38
...
...
@@ -9,7 +9,7 @@
use
byteorder
::{
BigEndian
as
BE
,
ByteOrder
};
use
std
::
ops
::
Deref
;
#[derive(C
lone,
Debug
)]
#[derive(C
opy,
Clone,
Debug,
PartialEq,
Eq,
Hash
)]
pub
struct
FontInfo
<
Data
:
Deref
<
Target
=
[
u8
]
>>
{
data
:
Data
,
// pointer to .ttf file
// fontstart: usize, // offset of start of font
...
...
@@ -25,7 +25,7 @@ pub struct FontInfo<Data: Deref<Target = [u8]>> {
index_to_loc_format
:
u32
,
// format needed to map from glyph index to glyph
}
#[derive(Copy,
Clone,
Debug)]
#[derive(Copy,
Clone,
Debug
,
PartialEq,
Eq,
Hash
)]
#[repr(C)]
pub
struct
Vertex
{
pub
x
:
i16
,
...
...
@@ -82,7 +82,7 @@ fn test_invalid_vertex_type() {
println!
(
"{}"
,
s
);
}
#[derive(Copy,
Clone,
Debug,
PartialEq,
Eq)]
#[derive(Copy,
Clone,
Debug,
PartialEq,
Eq
,
Hash
)]
#[repr(u8)]
pub
enum
VertexType
{
MoveTo
=
1
,
...
...
@@ -90,7 +90,7 @@ pub enum VertexType {
CurveTo
=
3
,
}
#[derive(Copy,
Clone,
Debug)]
#[derive(Copy,
Clone,
Debug
,
PartialEq,
Eq,
Hash
)]
pub
struct
Rect
<
T
>
{
pub
x0
:
T
,
pub
y0
:
T
,
...
...
@@ -98,13 +98,13 @@ pub struct Rect<T> {
pub
y1
:
T
,
}
#[derive(Copy,
Clone,
Debug)]
#[derive(Copy,
Clone,
Debug
,
PartialEq,
Eq,
Hash
)]
pub
struct
HMetrics
{
pub
advance_width
:
i32
,
pub
left_side_bearing
:
i32
,
}
#[derive(Copy,
Clone,
Debug)]
#[derive(Copy,
Clone,
Debug
,
PartialEq,
Eq,
Hash
)]
pub
struct
VMetrics
{
pub
ascent
:
i32
,
pub
descent
:
i32
,
...
...
@@ -1215,7 +1215,7 @@ impl<Data: Deref<Target = [u8]>> FontInfo<Data> {
}
}
#[derive(Clone,
Copy)]
#[derive(Clone,
Copy
,
PartialEq,
Eq,
Hash,
Debug
)]
pub
struct
FontNameIter
<
'a
,
Data
:
Deref
<
Target
=
[
u8
]
>>
{
/// Font info.
font_info
:
&
'a
FontInfo
<
Data
>
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment