diff --git a/font-renderer/Cargo.toml b/font-renderer/Cargo.toml index 39c3a553..abae3b13 100644 --- a/font-renderer/Cargo.toml +++ b/font-renderer/Cargo.toml @@ -29,9 +29,7 @@ freetype-sys = "0.6" [target.'cfg(target_os = "macos")'.dependencies] core-graphics = "0.13" - -[target.'cfg(target_os = "macos")'.dependencies.core-text] -git = "https://github.com/servo/core-text-rs.git" +core-text = "9.2" [target.'cfg(target_os = "windows")'.dependencies] dwrite-sys = "0.2" diff --git a/shaders/gles2/common.inc.glsl b/shaders/gles2/common.inc.glsl index 9277f292..723c4045 100644 --- a/shaders/gles2/common.inc.glsl +++ b/shaders/gles2/common.inc.glsl @@ -100,6 +100,10 @@ vec2 hintPosition(vec2 position, vec4 pathHints) { return vec2(position.x, y); } +vec2 quantize(vec2 position) { + return (floor(position * 10000.0 + 0.5) - 0.5) / 10000.0; +} + /// Converts the given 2D position in clip space to device pixel space (with origin in the lower /// left). vec2 convertClipToScreenSpace(vec2 position, ivec2 framebufferSize) { diff --git a/shaders/gles2/stencil-aaa.vs.glsl b/shaders/gles2/stencil-aaa.vs.glsl index 74f458cc..69046af7 100644 --- a/shaders/gles2/stencil-aaa.vs.glsl +++ b/shaders/gles2/stencil-aaa.vs.glsl @@ -63,9 +63,9 @@ void main() { mat2 transformLinear = globalTransformLinear * localTransformLinear; // Perform the linear component of the transform (everything but translation). - fromPosition = transformLinear * fromPosition; - ctrlPosition = transformLinear * ctrlPosition; - toPosition = transformLinear * toPosition; + fromPosition = quantize(transformLinear * fromPosition); + ctrlPosition = quantize(transformLinear * ctrlPosition); + toPosition = quantize(transformLinear * toPosition); // Choose correct quadrant for rotation. vec4 bounds = fetchFloat4Data(uPathBounds, pathID, uPathBoundsDimensions); @@ -89,9 +89,7 @@ void main() { // Compute position and dilate. If too thin, discard to avoid artefacts. vec2 dilation = vec2(0.0), position; - if (abs(v02.x) < 0.0001) { - position.x = 0.0; - } else if (aTessCoord.x < 0.5) { + if (aTessCoord.x < 0.5) { position.x = min(min(fromPosition.x, toPosition.x), ctrlPosition.x); dilation.x = -1.0; } else {