Patrick Walton
d6b9e3bdfd
gfx: Fix Core Text font instantiation for Web fonts on Mac.
...
Fixes GitHub Octicons. A reftest has been added for this.
2015-08-04 17:07:44 -07:00
Patrick Walton
e9ec9289d6
gfx: Instantiate the CTFont
corresponding to a Mac font on demand.
...
This avoids panics in multiprocess mode.
2015-07-31 08:42:30 -07:00
Huon Wilson
b42117fe0c
Avoid undefined behaviour by allocating with align 1.
...
The allocation APIs require that the alignment is a power-of-two;
meaning 1 is the "I don't care" alignment, not 0.
2015-07-30 10:49:42 -07:00
Patrick Walton
6eacb0c995
gfx: Make display lists serializable using serde
.
...
This commit introduces the `serde` dependency, which we will use to
serialize messages going between processes in multiprocess Servo.
This also adds a new debugging flag, `-Z print-display-list-json`,
allowing the output of display list serialization to be visualized.
This will be useful for our experiments with alternate rasterizers.
2015-07-15 19:04:17 -07:00
Glenn Watson
f8eeef0eb4
Use atoms for font template structures.
2015-07-13 08:23:02 +10:00
Ms2ger
d6aa0915c3
Use the heap module through its facade in libstd.
2015-06-26 20:52:28 +02:00
Ms2ger
28086f3c75
Use Box::into_raw rather than boxed::into_raw.
...
The latter is deprecated.
2015-06-25 23:03:54 +02:00
Nicholas Nethercote
1553fada53
Instrument FreeType allocations.
...
This will allow reporting of memory usage by FreeType instances, which
are measured in the MiBs for LayoutWorker threads.
This change also makes FreeType allocations happen with jemalloc instead
of the system malloc, which is a good thing.
Finally, the change documents some dubiousness involving
FontContextHandle.
2015-06-10 15:48:19 -07:00
Corey Farwell
a9b0607bf1
Utilize if let
instead of match
in a few places
2015-06-09 21:15:38 -07:00
Corey Farwell
435e551753
Remove get_
prefix on getters
...
Part of #6224
I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
2015-06-02 08:54:44 -04:00
Nicholas Nethercote
e8fc406520
Reduce unsafe-ness in FontContextHandle::new().
...
Because `box + boxed::into_raw() + boxed::from_raw` is nicer than
`libc::malloc() + mem::transmute() + ptr::write() + libc::free()`.
2015-05-27 21:50:09 -07:00
Nicholas Nethercote
16ba32521b
Don't leak the struct_FT_MemoryRec_.
...
We libc::malloc() a struct_FT_MemoryRec_ and pass it to FreeType. We
need to libc::free() it as well when FreeType is done with it.
2015-05-27 21:22:11 -07:00
Jinwoo Song
557bb11bde
Use FT_Done_Library instead of FT_Done_Freetype
...
It is recommended to use FT_Done_Library with FT_New_Library
from freetype document.
Fixes #6191 .
2015-05-28 10:17:06 +09:00
Corey Farwell
8e3f4bba85
Reduce max line length from 150 to 120 characters
...
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
Michael Wu
51503a2816
Avoid selecting bitmap fonts from fontconfig
2015-05-19 21:10:04 -04:00
Ms2ger
2bfca8f96f
Remove unused imports.
2015-05-06 19:20:10 +02:00
Simon Sapin
8b522f2e7d
Rename Au methods with f32/f64 instead of frac32/frac/subpx
2015-05-05 18:23:29 +02:00
Simon Sapin
32d5e24922
Replace Au-related free functions in util::geometry with Au methods.
2015-05-05 17:36:03 +02:00
Simon Sapin
ef8edd4e87
Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.
2015-05-05 10:07:34 -04:00
Ms2ger
6a55ae06d7
Remove some as_slice calls.
2015-04-24 17:44:47 +02:00
Ms2ger
a8c7864c68
Stop using int in font_list.
2015-04-08 19:00:58 +02:00
Ms2ger
6ae74b6673
Pass the buffer to create_face_from_buffer.
...
It's better to hold on to the abstraction as long as possible.
2015-04-08 19:00:34 +02:00
Josh Matthews
a68fa74f4b
Remove int_uint feature from gfx.
2015-04-07 11:58:28 -04:00
Ms2ger
ba87666cdb
Update some code that's feature-gated under core.
2015-03-21 18:44:39 +01:00
Ms2ger
32d1e31c90
Replace most usage of std::old_io::File.
2015-03-20 23:47:29 +01:00
Simon Sapin
5ffd71cd5e
Fix some warnings in gfx.
2015-03-18 22:08:00 +01:00
Connor Jennings
f298089f02
Retain buffer for CGDataProviderCreateWithData. Fixes #5084 .
...
CGDataProviderCreateWithData just wraps the underlying buffer. The
underlying buffer needs to be kept around until the data provider is
freed. Adding the buffer to the FontTemplateData struct ensures it
sticks around.
2015-03-15 14:02:27 -04:00
Simon Sapin
d5dd1d658e
Upgrade to rustc ba2f13ef0 2015-02-04
2015-02-11 14:48:34 -08:00
Ms2ger
505159a464
Import the util crate as util rather than servo_util.
...
This used to conflict with the util crate from the standard library, which
has long since been removed.
The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
Patrick Walton
abddfa742f
gfx: Implement font-stretch
per CSS3-FONTS § 3.3 in the Core Text
...
font backend.
2015-01-28 12:42:52 -08:00
Josh Matthews
95fc29fa0d
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
2015-01-28 10:16:49 +10:00
Ms2ger
01ed338746
Move to to_owned rather than into_string.
...
into_string has been removed from Rust.
2015-01-20 14:49:07 +01:00
Ms2ger
7eb659371d
Stop calling is_not_null.
...
It has been removed from Rust.
2015-01-20 13:08:49 +01:00
Matthew Rasmus
9881ecf8e2
Fix string::raw::from_buf
deprecation warning
2015-01-08 08:51:10 -08:00
Ms2ger
16c7060bc8
Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19.
2015-01-08 09:58:46 -05:00
Ms2ger
d759b07299
Qualify libstyle enums.
2015-01-04 15:04:35 +01:00
Ms2ger
be5e9b4278
Remove some obsolete formatting traits.
2015-01-04 11:59:51 +01:00
Ms2ger
b51e83819d
Fix obsolete format traits.
...
They are to be removed from the language in the next rust upgrade.
2015-01-02 19:04:18 +01:00
Manish Goregaokar
e973213606
gfx: to_string() -> into_string()
2014-12-27 14:48:35 +01:00
Ms2ger
466faac2a5
Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.
2014-12-17 15:19:45 -05:00
Joseph Crail
c254d195ad
Fix spelling mistakes in comments.
2014-12-11 23:56:29 -05:00
Tetsuharu OHZEKI
f04c64f500
Replace almost "render" to "paint" words in gfx crate.
2014-12-08 14:55:30 +09:00
Jack Moffitt
d1b433a3b3
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
2014-11-13 11:17:43 +10:00
Glenn Watson
8331cfe089
Convert internal font code to store pt size as Au.
2014-10-22 13:49:41 +10:00
Glenn Watson
cf3d9dffd1
Update rust-core-text, handle empty font collections. Fixes #3703 .
2014-10-21 14:54:37 +10:00
Tim Taubert
35f8270c64
Remove unnecessary deref()
s ( fixes #3586 )
2014-10-09 15:01:54 +02:00
Josh Matthews
be41c203ac
Fix linux build error.
2014-10-01 18:43:24 -04:00
Josh Matthews
8112859d55
Disallow toggling radio buttons. Use generated content for checkboxes and radio buttons. Switching to the glyph 0 for the average advance width.
2014-10-01 15:37:40 -04:00
Josh Matthews
9b20d6e7d2
Add average advance width to the font metrics structure, using the X glyph as a best guess.
2014-10-01 15:03:15 -04:00
Keegan McAllister
dc86e83654
Eliminate warnings
2014-09-20 13:00:55 -07:00