subpixel

Poor anti-aliasing of text drawn on Canvas

混江龙づ霸主 提交于 2019-11-27 23:11:11
I'm drawing text on Canvas, and am disappointed with the quality of antialiasing. As far as I've been able to determine, browsers don't do subpixel antialising of text on Canvas. Is this accurate? This is particularly noticeable on iPhone and Android, where the resulting text isn't as crisp as text rendered by other DOM elements. Any suggestions for high quality text out put on Canvas? Joubert My answer came from this link, maybe it will help someone else. http://www.html5rocks.com/en/tutorials/canvas/hidpi/ The important code is as follows. // finally query the various pixel ratios

Animate CSS background-position with smooth results (sub-pixel animation)

感情迁移 提交于 2019-11-27 18:24:01
I'm trying to animate the background-position of a div, slowly, but without it having jerky movement. You can see the result of my current efforts here: http://jsfiddle.net/5pVr4/2/ @-webkit-keyframes MOVE-BG { from { background-position: 0% 0% } to { background-position: 187% 0% } } #content { width: 100%; height: 300px; background: url(http://www.gstatic.com/webp/gallery/1.jpg) 0% 0% repeat; text-align: center; font-size: 26px; color: #000; -webkit-animation-name: MOVE-BG; -webkit-animation-duration: 100s; -webkit-animation-timing-function: linear; -webkit-animation-iteration-count: infinite

Subpixel anti-aliased text on HTML5's canvas element

北城余情 提交于 2019-11-27 11:39:31
I'm a bit confused with the way the canvas element anti-aliases text and am hoping you all can help. In the following screenshot the top "Quick Brown Fox" is an H1 element and the bottom one is a canvas element with text rendered on it. On the bottom you can see both "F"s placed side by side and zoomed in. Notice how the H1 element blends better with the background: Here's the code I'm using to render the canvas text: var canvas = document.getElementById('canvas'); if (canvas.getContext){ var ctx = canvas.getContext('2d'); ctx.fillStyle = 'black'; ctx.font = '26px Arial'; ctx.fillText('Quick

Sub-Pixels calculated and rendered differently among browsers

早过忘川 提交于 2019-11-27 01:51:16
The purpose: I am working on a code similar to this to create a component where an input field has an embedded button : http://codepen.io/anon/pen/pgwbWG?editors=110 As you can see, the button is positioned absolutely with top and bottom set to 0 , to achieve a 100% height element. Also to note is that the border of the text-input must stay visible and also wrap the button . To achieve this I added a margin: 1px to the button so that there is (should be) space to display the surrounding text-input red border (usually when the input field content is invalid). The problem: is that on Firefox it

Can you have a 0.5px border on a Retina Display?

旧巷老猫 提交于 2019-11-27 01:12:21
问题 On Mobile Safari on an iPhone 4 or iPhone4S, can you have a border of a div that is 0.5px wide? 回答1: I wrote an overview of different techniques : Half-pixel border border: 0.5px solid black; Cons: Works only in Firefox and Webkit Nightly. border-image border-width: 1px; border-image: url(border.gif) 2 repeat; border.gif is a 6×6 pixel image: Pros: It works! Cons: An external image. It’s only 51 bytes and it can be inlined using Data URI. You’d need to fire up Photoshop (or whatever you use)

Poor anti-aliasing of text drawn on Canvas

落爺英雄遲暮 提交于 2019-11-26 23:16:48
问题 I'm drawing text on Canvas, and am disappointed with the quality of antialiasing. As far as I've been able to determine, browsers don't do subpixel antialising of text on Canvas. Is this accurate? This is particularly noticeable on iPhone and Android, where the resulting text isn't as crisp as text rendered by other DOM elements. Any suggestions for high quality text out put on Canvas? Joubert 回答1: My answer came from this link, maybe it will help someone else. http://www.html5rocks.com/en

Animate CSS background-position with smooth results (sub-pixel animation)

自古美人都是妖i 提交于 2019-11-26 15:41:58
问题 I'm trying to animate the background-position of a div, slowly, but without it having jerky movement. You can see the result of my current efforts here: http://jsfiddle.net/5pVr4/2/ @-webkit-keyframes MOVE-BG { from { background-position: 0% 0% } to { background-position: 187% 0% } } #content { width: 100%; height: 300px; background: url(http://www.gstatic.com/webp/gallery/1.jpg) 0% 0% repeat; text-align: center; font-size: 26px; color: #000; -webkit-animation-name: MOVE-BG; -webkit-animation

Subpixel anti-aliased text on HTML5's canvas element

最后都变了- 提交于 2019-11-26 15:37:39
问题 I'm a bit confused with the way the canvas element anti-aliases text and am hoping you all can help. In the following screenshot the top "Quick Brown Fox" is an H1 element and the bottom one is a canvas element with text rendered on it. On the bottom you can see both "F"s placed side by side and zoomed in. Notice how the H1 element blends better with the background: Here's the code I'm using to render the canvas text: var canvas = document.getElementById('canvas'); if (canvas.getContext){ var

Sub-Pixels calculated and rendered differently among browsers

让人想犯罪 __ 提交于 2019-11-26 09:45:37
问题 The purpose: I am working on a code similar to this to create a component where an input field has an embedded button : http://codepen.io/anon/pen/pgwbWG?editors=110 As you can see, the button is positioned absolutely with top and bottom set to 0 , to achieve a 100% height element. Also to note is that the border of the text-input must stay visible and also wrap the button . To achieve this I added a margin: 1px to the button so that there is (should be) space to display the surrounding text