Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Font in HTML5 Canvas/JS is bolder/softer, compared to sharper/thinner in AS3/SWF?

Guest
May 09, 2019 May 09, 2019

Is there a way to achieve the same quality (sharp, thinner) look of a SWF font display within the HTML5 Canvas environment?

I have this old site that currently uses SWF for some minor text animations (screenshot 1 below) that I’ve been attempting to recreate using HTMl5 with Animate (screenshot 2 below).

After finally figuring out how to implement the JS/HTML5 into my old site’s html, I’m now at a lost as to how to achieve the same look as my original SWF display involving mostly text.

Should note also, when in HTML Canvas the web font option and the embed font option are greyed out in the properties panel (presumably that’s the way it’s supposed to be).

Any help is appreciated.

Thanks.

1. AS3/SWF in chrome browser.

Screen Shot 2019-05-09 at 23.33.48.png

2. HTML5 canvas/JS in chrome browser.

Screen Shot 2019-05-09 at 23.33.59.png

1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , May 10, 2019 May 10, 2019

Hi,

you could use dynamic text for crisper fonts (i.e. use Web Fonts- though some fonts show better than others and at different sizes). Use either from Adobe or Google Web Fonts which get embedded once you find the font (click on the 'World' icon to the right of the Family drop down in the Character part to search). Once you add a font then these Web Fonts can then be found listed at the top of your Family drop down menu. Though the font family you have used may not be among their lists.

Another

...
Translate
Engaged ,
May 10, 2019 May 10, 2019

Hi,

you could use dynamic text for crisper fonts (i.e. use Web Fonts- though some fonts show better than others and at different sizes). Use either from Adobe or Google Web Fonts which get embedded once you find the font (click on the 'World' icon to the right of the Family drop down in the Character part to search). Once you add a font then these Web Fonts can then be found listed at the top of your Family drop down menu. Though the font family you have used may not be among their lists.

Another idea is to put your text on a rounded up/down pixel position in Properties eg. if your text box is positioned x = 5.2 and the y = 7.8 then round up/down to x = 5 and y = 8.

Hope this helps in someway.

Cheers

Greg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 10, 2019 May 10, 2019

Making it dynamic text was definitely a big help. It looks closer to what it was originally now. But notice the spacing is tighter, and it’s still not as sharp and crisp as the original, but at this point I’ll take this over what it was previously. We’re definitely moving forward, but not quite out of the woods yet.

But yeah, back to the spacing, notice that kerning and tracking are greyed out now?

There’s no way for me to adjust the spacing?

Why is this so madenning, when I’m just working with text?

I just don’t get it.

Original SWF live in Chrome.

Screen Shot 2019-05-10 at 14.09.10.png

HTML5/JS in Chrome.

Screen Shot 2019-05-10 at 14.09.21.png

Letter spacing and auto kern are greyed out/inoperable.

Screen Shot 2019-05-10 at 14.09.40.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 10, 2019 May 10, 2019

https://forums.adobe.com/people/neal+derekl34934377  wrote

I just don’t get it.

Canvas documents use the canvas text-drawing API to draw text. The canvas text-drawing API doesn't support configurable letter spacing.

There, now you get it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2019 May 10, 2019
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 10, 2019 May 10, 2019

Welcome back to the world of dealing with browser differences. How text is rendered to canvas is entirely under the control of the browser. If you want pixel-perfect rendering, you'll have to turn your text into bitmaps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 10, 2019 May 10, 2019
LATEST

I ended up using dynamic text, then Break Apart, followed by moving each letter individually to achieve the desired spacing.

This would be tedious if I had text heavy Animate projects.

Next time I encounter something like this, exploring creating text via other apps may be a solve, like InDesign, and exporting as a PDF or EPS, or whatever Animate is compatible with.

In all, each suggestion helped me to better understand Animate and HTML5’s capabilities and limitations a lot clearer.

Thanks all.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines