Skip to content

Label layout breaks when font is missing #56

@tobil4sk

Description

@tobil4sk

When a font is missing and a label uses a non-default font-size, then it seems to ignore the label size when laying out the remaining content.

Expected Behavior

The layout should respect the font size of the label.

Current Behavior

The label's font size is ignored.

Possible Solution

I ran into this because the default font was Arial, which has been changed in 10d6289. Updating to the latest git version of haxeui-html5 and avoiding fonts that may not exist universally avoids this issue.

Steps to Reproduce (for bugs)

  1. Use the main-view.xml given in the minimal test case.

  2. Observe the broken layout.

Media

First example

Initial layout:
image

Layout after 2 seconds pass:
image

Second example

Initial layout:
image

Layout after 2 seconds pass:
image

Test app / minimal test case

This example reproduces the behaviour:

<vbox style="padding: 5px;">
    <hbox>
        <label text="broken" style="font-family: 'BOB'; font-size: 30px"/>
        <label text="normal" />
    </hbox>
</vbox>

In the above case, the layout becomes correct after two seconds pass, however, in more complicated scenarios it remains broken even after updating:

<vbox style="padding: 5px;">
    <hbox>
        <label text="broken" style="font-family: 'BOB'; font-size: 30px"/>
        <label text="broken" style="font-family: 'BOB'; font-size: 30px"/>
        <label text="normal" />
    </hbox>
</vbox>

Your Environment

Behaviour seems consistent between firefox and chrome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions