Permalink
Browse files

Disable subpixel antialiasing on text layers.

  • Loading branch information...
eelco committed Sep 28, 2017
1 parent a61783d commit 790e32e1ffb9a4ee75ac6d8067bd9467d6cb4f39
Showing with 3 additions and 2 deletions.
  1. +1 −0 framer/StyledText.coffee
  2. +2 −2 test/tests/TextLayerTest.coffee
View
@@ -152,6 +152,7 @@ class StyledTextBlock
createElement: ->
div = document.createElement "div"
div.style.fontSize = "1px"
div.style.webkitFontSmoothing = "antialiased"
maybeLineBreak = @inlineStyles.length is 1
for style in @inlineStyles
span = style.createElement(maybeLineBreak)
@@ -129,8 +129,8 @@ describe "TextLayer", ->
it "should set the correct defaults", ->
text = new TextLayer
text.text.should.equal "Hello World"
text.html.should.equal '<div style="font-size: 1px;"><span style="font-size: 40px;">Hello World</span></div>'
text._elementHTML.outerHTML.should.equal '<div style="zoom: 1; overflow: visible; color: rgb(136, 136, 136); font-family: -apple-system, BlinkMacSystemFont, \'SF UI Text\', \'Helvetica Neue\'; font-weight: 400; font-style: normal; font-size: 40px; line-height: 1.25; text-transform: none; outline: none; white-space: pre-wrap; word-wrap: break-word; text-align: left;"><div style="font-size: 1px;"><span style="font-size: 40px;">Hello World</span></div></div>'
text.html.should.equal '<div style="font-size: 1px; -webkit-font-smoothing: antialiased;"><span style="font-size: 40px;">Hello World</span></div>'
text._elementHTML.outerHTML.should.equal '<div style="zoom: 1; overflow: visible; color: rgb(136, 136, 136); font-family: -apple-system, BlinkMacSystemFont, \'SF UI Text\', \'Helvetica Neue\'; font-weight: 400; font-style: normal; font-size: 40px; line-height: 1.25; text-transform: none; outline: none; white-space: pre-wrap; word-wrap: break-word; text-align: left;"><div style="font-size: 1px; -webkit-font-smoothing: antialiased;"><span style="font-size: 40px;">Hello World</span></div></div>'
text.color.isEqual("#888").should.equal true
text.backgroundColor.isEqual("transparent").should.equal true
text.padding.should.eql 0

0 comments on commit 790e32e

Please sign in to comment.