Amp-wp: Text font size is sometimes incorrect

Created on 21 May 2019  路  5Comments  路  Source: ampproject/amp-wp

QA noticed an issue which doesn't occur 100% of times and that doesn't necessarily have a way how to faithfully reproduce it, however, here are the steps where it sometimes happens:

  • Add a Text block
  • Make sure that amp-fit-text is on.
  • Resize the block little by little
  • In some cases, the font size displays very small.

image (1)

AMP Stories (obsolete) Bug

Most helpful comment

Good catches.

Notice that you are not able to make the text block smaller than it currently is.

I'll look into this.

Also, when turning off fit-text, the font size changes a bit.

Will look into that as well.

When turning off fit-text, shouldn't the font size change to something so that the text still fits into the container?

I don't know :) Originally the idea was to store the user-selected font so that it could be restored.
But the previous issue you found might already improve this, looks like it always sets 72 as the custom font after using amp-fit-text.

All 5 comments

I was testing it yesterday and was resizing the block A LOT for a long time and wasn't able to reproduce the issue. It did happen more often previously at the time when this issue was created, I was able to replicate it then. There have been quite a few changes meanwhile, perhaps it's not an issue anymore.

Could you please test it as well to see if you encounter the issue and if not then perhaps we can close this issue for now, @kienstra @swissspidy?

While I was not able to reproduce this exact issue, I noticed something else:

  1. Create text block with some text.
  2. Resize block a bit.
  3. Turn fit-text off
  4. Resize block a bit.
  5. Turn fit-text on again.
  6. Notice that you are not able to make the text block smaller than it currently is.

Video: https://cloudup.com/cBOQLWCkkmC

As if the calculation to restrict resizing is still in place, even though amp-fit-text should allow resizing to any value.

Also, when turning off fit-text, the font size changes a bit.
Then, when turning back on and off again, the font size changes again, but to a _different_ value.

Video: https://cloudup.com/c6COZqhf-6G

When turning off fit-text, shouldn't the font size change to something so that the text still fits into the container?

Good catches.

Notice that you are not able to make the text block smaller than it currently is.

I'll look into this.

Also, when turning off fit-text, the font size changes a bit.

Will look into that as well.

When turning off fit-text, shouldn't the font size change to something so that the text still fits into the container?

I don't know :) Originally the idea was to store the user-selected font so that it could be restored.
But the previous issue you found might already improve this, looks like it always sets 72 as the custom font after using amp-fit-text.

Instructions for testing:
1:

  • Create a text block with some text.
  • Resize block a bit.
  • Turn "Automatically fit text to container" setting off.
  • Resize block a bit.
  • Turn "Automatically fit text to container" setting on again.
  • Verify that it's possible to resize the Text block smaller.

2:

  • Create a text block with some text.
  • Turn "Automatically fit text to container" setting off.
  • Set custom font size to 20 (or any other custom size).
  • Turn "Automatically fit text to container" setting on.
  • Resize block to be quite large.
  • Turn "Automatically fit text to container" setting off again.
  • Verify that the previous custom font size has remained at 20 (or any other custom size that was chosen).

Verified in QA

Was this page helpful?
0 / 5 - 0 ratings