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

Stroke text via code in HTML5 canvas

Participant ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Good evening everyone, in the HTML5 canvas is it possible to add a stroke to a text with a line of code? as done, for example, to add a shadow:
this.shadow = new createjs.Shadow("rgba(0,0,0,0.9)",0,0,9);

thank you all so much for any help!

TOPICS
Ad development , Code , How to

Views

597

Translate

Translate

Report

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

Community Expert , Apr 13, 2023 Apr 13, 2023

Hi.

 

Set a value bigger than 0 to the outline property. For example:

this.yourTF.outline = 2;

 

If needed, place two text fields over each other to keep the fill and the stroke.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
Participant ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

thank you very much but maybe i misunderstood, i already have some text, i need to add an outer border to this text using code instead of converting it to shape and manually adding the stroke to each letter...

it can probably be done with a trick using a multiple shadow as well but I'm not very handy with the code in the html5 canvas

Votes

Translate

Translate

Report

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 ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

Sorry, I wasn't helpful. Hopefully, you get it figured out.

Votes

Translate

Translate

Report

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
Participant ,
Apr 19, 2023 Apr 19, 2023

Copy link to clipboard

Copied

Thanks anyway, any help is always helpful! Thanks again

Votes

Translate

Translate

Report

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 ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

Hi.

 

Set a value bigger than 0 to the outline property. For example:

this.yourTF.outline = 2;

 

If needed, place two text fields over each other to keep the fill and the stroke.

 

Regards,

JC

Votes

Translate

Translate

Report

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 ,
Apr 20, 2023 Apr 20, 2023

Copy link to clipboard

Copied

LATEST

This is good information JoãoCésar

 

Votes

Translate

Translate

Report

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