Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic text not rendering for single lines when using bold or italic fonts #4

Open
rob-bateman opened this issue Jul 24, 2020 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rob-bateman
Copy link
Contributor

rob-bateman commented Jul 24, 2020

Description
When setting up a single line dynamic textfield or input field, setting the font type to bold, italic or bold italic causes the text to disappear

Platform
All

Steps to reproduce the issue
Steps to reproduce the behavior:

  1. Create an swf with a single line text field on the stage and write some text into the field
  2. Set the type of text to dynamic or input
  3. Set the style to bold, italic or bold italic and ensure the font chosen is embedded
  4. Run in AwayFL

Expected outcome
The textfield with its containing text appears

Actual outcome
No text is displayed

@rob-bateman rob-bateman added the bug Something isn't working label Jul 24, 2020
@rob-bateman rob-bateman added this to the SatProf tests milestone Jul 24, 2020
@rob-bateman rob-bateman self-assigned this Jul 24, 2020
@rob-bateman rob-bateman assigned 80prozent and unassigned rob-bateman Jul 24, 2020
@80prozent
Copy link
Contributor

i think what happens is this:

for some reason, some textfields get stroed in swf as html-enabled textfields even when they are not set to html in the Animate IDE.

This allows swf to store the textformat-properties as part of the html-string. <p font="someFont" fontSize="12>sometext

`

Now when we try to set text dynamically via myTextField.text="someNewText" it no longer has the correct TextFormat information that was provided by the html-string.

The fix will probably be to process the html on aprsing time, and extract the textformat for later use.

@80prozent
Copy link
Contributor

This is also a bit more compilcated than anticipated.

Needs a refactor of Font in order to get this solved.

In AwayJS we store a Font with a list of Font-styles.

In FP, a Font does not have a list of FontStyles. each FontStyle comes as a sepperate Font-object.

This makes for differences in how Fonts can be accessed via name.

I will need to refactor this, so that our approach matches the FP appraoch more closly, but i am still unsure how to handle switching between fontstyles of the same font when fontstyles are not grouped by font.

@80prozent
Copy link
Contributor

btw: the description of the issue isnt very accurate.

Its not the singleline vs multiline thats causing the fonts to disappear. it is rather dynamically changing of the textfield.text which causes issues with some fonts / fontstyles.

@80prozent
Copy link
Contributor

was fixed by awayjs/scene@77e7b4e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants