eclipse-rap / org.eclipse.rap

Eclipse RAP Runtime (Remote Application Platform)
https://www.eclipse.org/rap/
Eclipse Public License 1.0
17 stars 19 forks source link

Support for bug 460945 and others (text cutoff with custom font) #204

Open kysmith-csg opened 1 month ago

kysmith-csg commented 1 month ago

I am encountering https://bugs.eclipse.org/bugs/show_bug.cgi?id=460945 with View/Editor tabs: image

Related bugs: https://bugs.eclipse.org/bugs/show_bug.cgi?id=531450 https://bugs.eclipse.org/bugs/show_bug.cgi?id=533504 https://bugs.eclipse.org/bugs/show_bug.cgi?id=366151

You can see the text is cut off in the tab even though there should be plenty of space on the side. Refreshing the page or performing Reset Perspective causes the size to be correct.

One thing I noticed is that, on Refresh, the Close button is moved to the right, as if it was initially being drawn with too much right padding.

The font I am using is Montserrat 16pt normal. This is a custom font that is downloaded to the client via org.eclipse.rap.rwt.client.service.ClientFileLoader.requireCss(String). I am defining the font in a custom theme stylesheet:

CTabItem, TabItem {
    color: white;
    font: normal 16px 'Montserrat', sans-serif;
    background-color: #1774e5;
    background-image: none;
}

The other bugzilla tickets above show similar issues with things being cut off, as if the layout is being calculated too "early".

Is there any known workaround for this? I don't want to manually reset the perspective since the user's settings would be gone, and asking the shell to redraw seems to do nothing in RAP.