Commit graph

81 commits

Author SHA1 Message Date
Patrick Walton
3addd775a5 gfx: Change the mapping from Mac weights to CSS weights so that 0.0 maps
to 400, not 500.

CSS `normal` font-weight is specified as 400, while Mac "Regular" font
weight is reported as 0.0. On the Mac, we need to center the two ranges
on the same value to avoid choosing "Light" fonts where "Regular" would
have been more appropriate.

Closes #9487.

fix for mac
2016-05-10 10:34:29 -07:00
Patrick Walton
2ac9747023 gfx: Map sans-serif to Helvetica on Mac, DejaVu Sans on Linux, and
Roboto on Android.

This matches what I believe the OS native defaults to be.

Partially addresses #9487.
2016-05-09 12:45:52 -07:00
Patrick Walton
18fbf8cf30 gfx: Clamp the font size we supply to Core Text to 0.01pt.
Core Text treats a font size of 0.0 as 12.0, which is obviously not what
we want.

Improves Twitter.
Improves Reddit /r/rust.

Closes #10492.
2016-04-11 13:52:41 -07:00
Anthony Ramine
46c505e47b Bump serde to 0.7 2016-03-17 13:52:39 +01:00
Glenn Watson
c0531c312f Add WebRender integration to Servo.
WebRender is an experimental GPU accelerated rendering backend for Servo.

The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).

WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
2016-02-18 10:35:29 +10:00
Anthony Ramine
55dcee94be Bump heapsize to 0.3 2016-02-13 11:13:19 +01:00
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
Vladimir Vukicevic
025ed57c04 win32: use fontconfig/freetype on windows as well (for now) 2016-01-20 08:38:20 -06:00
Matthew Kuo
8ecc120211 changed gfx private types to public 2016-01-17 04:48:32 -08:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
Olaf Buddenhagen
c5ede5851e Derive Debug on FontGroup and its components 2015-12-12 10:04:33 +01:00
Alan Jeffrey
3dec6edd10 Update string_cache to 0.2.
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced atom!(foo) by atom!("foo").
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
2015-11-25 10:13:21 -06:00
Michael Wu
7cbef87b00 Avoid overflow in freetype/font_context.rs 2015-11-16 13:07:56 -05:00
Corey Farwell
20beaf5af3 Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Glenn Watson
5684a75187 A few clean ups for Au type 2015-09-28 16:05:16 +10:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Manish Goregaokar
3c969b346a Upgrade rust to f93ab64d4a1a7ee91759a1594ab2a426b6cc657e/rustc-1.5.0-dev. 2015-09-23 14:44:59 +02:00
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Mathieu Rheaume
7320433cca Remove 'get_*' on getters as per RFC 0344 on various components 2015-09-12 20:14:01 -04:00
Matt Brubeck
afafb0b71c Implement get_table_for_tag on FreeType
Also fixes use-after-free of FontTable buffers.
2015-09-03 13:35:44 -07:00
bors-servo
15de679f11 Auto merge of #7468 - JoshTheGoldfish:Issue7460, r=jdm
Making test-tidy check that = have space after them

For issue #7460. Need to ensure compatibility with #7390.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7468)
<!-- Reviewable:end -->
2015-09-01 08:33:02 -06:00
erneyja
17663315dd make test-tidy check that = have space after them 2015-09-01 07:18:19 -04:00
Matt Brubeck
998bec30cf Remove no-op Drop implementation from FontTable
This is no longer necessary for opting out of the Copy trait.
2015-08-28 10:43:04 -07:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
Corey Farwell
df79c8f8fa Utilize match guard; make methods more similar
Make the structure for the `stretchiness` and `boldness` methods more
similar
2015-08-11 18:28:50 -04:00
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