83367 Commits

Author SHA1 Message Date
Raph Levien
92e8cc7071 Silently ignore invalid rangeOffset values
Some fonts contain a cmap segment for char 0xffff that contains an
invalid rangeOffset. This was rejected by the existing code, which
means the font is considered to have empty Unicode coverage. This patch
just discards the invalid segment (consistent with OpenType Sanitizer),
making the custom font display.

Bug: 18106256
Change-Id: Icc8616a3030f80e62db906332be64d434ae72ea2
2014-10-23 23:31:42 +00:00
Rafael Weinstein
ccca233ad5 Update HACKING.md 2014-10-23 16:10:08 -07:00
Eric Seidel
0c525575cb Add --gdb argument to skydb
Makes it trivial to drop into gdb having launched
mojo_shell/sky with the right arguments.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/672383002
2014-10-23 16:02:39 -07:00
Rafael Weinstein
b6c1140c8e Fixing the fix 2014-10-23 16:02:04 -07:00
Eric Seidel
dd992e5f2f Teach tools/skydb how to handle paths
This makes it much easier to hack on test cases.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/654543004
2014-10-23 16:00:10 -07:00
Rafael Weinstein
b061da457e Added build instructions 2014-10-23 15:54:51 -07:00
Eric Seidel
86cd8beee7 Make skydb load examples/home.sky by default.
I had to also register for the text/plain mime-type
which turned out to be harder than expected.
Mostly due to my confusion with mojo_shell
using last-argument-wins argument parsing.

R=ianh@google.com

Review URL: https://codereview.chromium.org/672363002
2014-10-23 14:56:44 -07:00
Eric Seidel
d79cb9d734 Make skydb load examples/home.sky by default.
I had to also register for the text/plain mime-type
which turned out to be harder than expected.
Mostly due to my confusion with mojo_shell
using last-argument-wins argument parsing.

R=ianh@google.com

Review URL: https://codereview.chromium.org/672363002
2014-10-23 14:56:44 -07:00
John Abd-El-Malek
3c84485f2a Fix build.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/659043004
2014-10-23 14:54:07 -07:00
James Robinson
63a8a02db2 Fix sky build on android
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/678533002
2014-10-23 14:50:37 -07:00
Hixie
928524947a Placeholder Sky start page.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/677513002
2014-10-23 13:42:24 -07:00
Hixie
e6903a0867 Placeholder Sky start page.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/677513002
2014-10-23 13:42:24 -07:00
Eric Seidel
9f5a253a9e Teach tools/skydb how to take a URL as a parameter.
Turns out our shut-down code in debugger.cc is never
called.  Need to talk to Ben to figure out how
to listen for the CloseWindow.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/658113004
2014-10-23 13:40:48 -07:00
Adam Barth
4a2c99c0ec Update TestExpectations to match reality
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/671633005
2014-10-23 12:19:02 -07:00
Adam Barth
546708872d Add another missing dependency 2014-10-23 12:02:07 -07:00
Adam Barth
a3ca0e52d6 Add Sky to the build system
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/657863003
2014-10-23 11:29:54 -07:00
Adam Barth
00882d626a Open the Sky 2014-10-23 11:17:19 -07:00
Adam Barth
b3df23f7c1 Open the Sky 2014-10-23 11:17:19 -07:00
Adam Barth
3c8baa179f Add a README.md for Sky
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/672963002
2014-10-23 11:05:40 -07:00
Raph Levien
5f94c59c2e am 6cba4a1d: Fine-tune fake-bolding condition
* commit '6cba4a1dcae7ce1a359638405c3703b3cbb91277':
  Fine-tune fake-bolding condition
2014-09-23 16:17:41 +00:00
Raph Levien
6cba4a1dca Fine-tune fake-bolding condition
The old logic for fake bolding results in no fake bolding for a bold
span on a light weight (300) because the target weight (600 in this
case) didn't meet the condition. This patch fine-tunes the threshold
to enable fake bolding for this.

Bug: 17587185

Change-Id: I04abd00a74240cbed79c417f81486aa2158b2806
2014-09-22 18:21:34 +00:00
Raph Levien
5a3a896405 am ff55a581: Snap advance widths to integers
* commit 'ff55a581fa07b52f3cffcf3fc825d297cf955ffe':
  Snap advance widths to integers
2014-09-04 00:16:27 +00:00
Raph Levien
ff55a581fa Snap advance widths to integers
Fractional advance widths were causing subtle problems with text
positioning when the same text was drawn with different spans in the
hwui renderer. Quantizing the coordinates on layout (as opposed to
waiting until the renderer draws the glyphs) solves the problem.

This patch also fixes a discrepancy between x position and advance
widths when letterspacing.

Bug: 17347779
Change-Id: Ia705944047408c2839d5ad078eefd6bbec446872
2014-09-03 10:42:52 -07:00
Raph Levien
604053e564 am 543c65c8: Try Unicode decomposition for selecting fallback font
* commit '543c65c80b71e3111314bf429004a10d004e861b':
  Try Unicode decomposition for selecting fallback font
2014-08-27 17:07:48 +00:00
Raph Levien
543c65c80b Try Unicode decomposition for selecting fallback font
This patch finds an appropriate fallback font in the case where no font
directly maps the requested character, but a font does exist for the
character's canonical decomposition. This yields correct rendering of
compatibility characters such as U+FA70.

Bug: 15816880
Bug: 16856221
Change-Id: Idff8ed6b942fec992a0815a32028b95af091d0ee
2014-08-26 22:20:16 -07:00
Behdad Esfahbod
ddd99662c1 am 11c8920a: Allocate font vector on stack
* commit '11c8920a3fc1c5895e777f71c822501367eef69c':
  Allocate font vector on stack
2014-08-22 18:36:40 +00:00
Behdad Esfahbod
11c8920a3f Allocate font vector on stack
This reduces another allocation (last one?) we were doing when
fulfilling shaping requests from the cache.

Bug: 17111260
Change-Id: Ieb8ae1ccfcaacedb257e1e9263777f10623aaf98
2014-08-21 19:25:06 -04:00
Behdad Esfahbod
55f6f0cd86 am df03550a: Fix Layout initialization in the skipCache path
* commit 'df03550a40706a55ca1bfcb67da62765194cf98f':
  Fix Layout initialization in the skipCache path
2014-08-21 22:09:56 +00:00
Behdad Esfahbod
df03550a40 Fix Layout initialization in the skipCache path
C++ local var initialization always tricks me.  Previously, Layout
didn't have a constructor, which meant that defining it on the stack
left mAdvance uninitialized.  This was not an issue when we were doing
"new Layout()", since that invokes zero-initialization, but was an
issue for the skipCache path that was allocating layout on stack by
just "Layout l" instead of "Layout l = Layout()".  To avoid surprises,
add a constructors that clears everything.

Also adds reset() method to reset the layout for reuse.

Change-Id: I3e02f00da9dd7d360abe13f63c310f6882292d0a
2014-08-21 17:26:04 -04:00
Behdad Esfahbod
2f65c78209 am a33151e9: Speed up cache lookup
* commit 'a33151e9c78c5547eeadbaaa9168dad361df05e4':
  Speed up cache lookup
2014-08-21 20:39:33 +00:00
Behdad Esfahbod
a33151e9c7 Speed up cache lookup
Avoid copying the string for cache lookup.

Bug: 17111260
Change-Id: Ic220bfc991fc6b3dada197304aabdf72a8941bd7
2014-08-21 14:00:25 -04:00
Behdad Esfahbod
a50cc8616c am 2f24599f: Choose same font for Emoji keycap and its base character
* commit '2f24599f4a258160854d18096b302ec2c3aa66c9':
  Choose same font for Emoji keycap and its base character
2014-08-08 19:56:55 +00:00
Behdad Esfahbod
2f24599f4a Choose same font for Emoji keycap and its base character
The U+20E3 COMBINING KEYCAP is used in our fonts to generate an emoji
rendering of ASCII numbers and letters through GSUB.  For that to work
we need to choose the same (Emoji) font for the character coming
*before* the COMBINING KEYCAP character.

This is a special-case of a broader need to choose fonts per grapheme
cluster as opposed to per character, but for now, special-case U+20E3.

Bug: 7557244
Change-Id: I958e5a01068df8495bbb9bc3b9ed871cea1838b6
2014-08-08 15:37:28 -04:00
Behdad Esfahbod
f7a71d4b4e am a944efa7: Support fontFeatureSettings
* commit 'a944efa7a0e61169f56c0002b95e9d6951b1e86e':
  Support fontFeatureSettings
2014-07-30 21:42:58 +00:00
Behdad Esfahbod
a944efa7a0 Support fontFeatureSettings
Bug: 15246510
Change-Id: I544915d29b2be4fb9f82f1989188a3a918c50fbc
2014-07-30 17:29:00 -04:00
Behdad Esfahbod
947aaacee5 am 8bee8f92: Fix examples build
* commit '8bee8f92e045f5e709dbcbedd9d486b55e73f54e':
  Fix examples build
2014-07-29 21:17:20 +00:00
Behdad Esfahbod
6abdc7368f am 2d51f518: Merge "Remove CSS string doLayout entrypoint and supporting code" into lmp-dev
* commit '2d51f518d22eb897603c80f4df5149c711f705b2':
  Remove CSS string doLayout entrypoint and supporting code
2014-07-29 21:01:36 +00:00
Behdad Esfahbod
997dacbde1 am f3879f9b: Initialize MinikinPaint members
* commit 'f3879f9b1f5593552e96cd0f3c2cf755c376fb85':
  Initialize MinikinPaint members
2014-07-29 21:01:36 +00:00
Behdad Esfahbod
8bee8f92e0 Fix examples build
Was broken after recent CSS removal.

Change-Id: I160fbc73286b21336d6f3943ff92d7d150dff74b
2014-07-29 16:57:00 -04:00
Behdad Esfahbod
f3879f9b1f Initialize MinikinPaint members
We are stack-allocating MinikinPaint objects in Minikin clients, and
without a constructor adding new members to the struct cannot be done
without updating all clients (only one right now!).

Change-Id: I4170f16498bb6b07cb795495011aca58087ed0bd
2014-07-29 16:26:49 -04:00
Behdad Esfahbod
b501846d80 Add doLayout variant that does NOT take css string
New API removes CSS string and directly takes needed objects.

Bug: 16651112
Change-Id: Ie5f7c2ab05be6cbd77cae0a5fd6bb453771ada59
2014-07-29 12:46:07 -04:00
Behdad Esfahbod
2d51f518d2 Merge "Remove CSS string doLayout entrypoint and supporting code" into lmp-dev 2014-07-27 22:35:46 +00:00
Behdad Esfahbod
bff381b1be Remove CSS string doLayout entrypoint and supporting code
All usage is ported to the new doLayout() API now.

Bug: 16651112
Change-Id: I2c959138a69853b5e30098889d771fe5f4cfaa66
2014-07-29 15:51:12 -04:00
Behdad Esfahbod
94300c2146 Merge "Don't get stuck on invalid UTF-16" into lmp-dev 2014-07-24 15:37:54 +00:00
Behdad Esfahbod
abf2e7d050 Don't get stuck on invalid UTF-16
Replaces invalid unicode with replacement character U+FFFD and always
makes forward progress.

Bug: 15849380

Change-Id: Ic59ef6c64b0f5c4450bcae61597adcc269d6e7c5
2014-07-25 19:13:10 +00:00
Behdad Esfahbod
675a078bdf Towards CSS removal
Extract language from FontStyle during shaping.  Don't attach CSS
to LayoutContext.

Change-Id: Ie621d3415410178d0d15fa7b810eb8e412342ab6
2014-07-24 20:26:03 -04:00
Behdad Esfahbod
ded72d1e4a Remove deprecated API
It has been unused outside minikin.

Change-Id: Iaa2237767d81c77f90d0264e633375e601dd72f1
2014-07-24 19:18:14 -04:00
Behdad Esfahbod
801eb4ebad Merge "Revert "Don't pass invalid Unicode codepoint to Skia"" 2014-07-24 15:36:21 +00:00
Behdad Esfahbod
ca5b3e1676 Revert "Don't pass invalid Unicode codepoint to Skia"
After update to HarfBuzz 0.9.33 we don't need this anymore.  HarfBuzz takes care of invalid input and passes U+FFFD to us.

This reverts commit 29eb45e667be81d37f29fcce2adccb8c5e6d5ada.

Change-Id: Icfd0dc836a8d684fb1723fc215aa01f99639ff59
2014-07-25 17:31:46 +00:00
Behdad Esfahbod
7043f8f1fc Add letter-spacing support
Bug: 15594400
Change-Id: Ied94d7674be4097b0f44c9b0770d3294dc6433c1
2014-07-22 16:37:53 -04:00