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

[WIP] Update fonts CSS code to respect CSS standard specs #13143

Closed
wants to merge 1 commit into from

Conversation

Nilvus
Copy link
Contributor

@Nilvus Nilvus commented Dec 13, 2022

Closes #13084

This change all CSS code for elegant fonts. This needed to also remove some lines on main darktable theme. Lines removed were redundant and unuseful as they all inherit from line 240 with same setting.

I tested changes (on Japan language due to IPAPGothic font set and on Ukrainian one as well as non-Cyrillic language like French) on many parts and didn't see any changes except one:

  • all modules titles are less condensed (but remains condensed). I think that new way is better as they were way too condensed and it's more natural regarding fonts.

Now, code use correct way to handle font with CSS, starting from real family, then set light or bold or medium or condensed with font-weight and font-stretch settings.

@victoryforce, @Mark-64 and @dterrahe: your reviews are more than welcomed, especially to test if it's ok on Windows as I can test that part. Be sure to check #13084 issue of course and as far as possible with both Pango release pointed (the one who have the issue and the one who have not). I hope that new code will work with both versions.

@Mark-64: another thing, good if you can check if that PR do not break your fix related to last one on that PR: #7671

@Nilvus Nilvus added bugfix pull request fixing a bug scope: UI user interface and interactions scope: codebase making darktable source code easier to manage labels Dec 13, 2022
@Nilvus Nilvus added this to the 4.2.1 milestone Dec 13, 2022
@Mark-64
Copy link
Contributor

Mark-64 commented Dec 14, 2022

Unfortunately it doesn't work in Windows.
While I agree to move closer to the Css and Gtk standards, it looks like the current implementation in pango 1.50.12 is quite bugged.
See below some examples using gtk3-demo, but same results in darktable

It kind of works with standard settings

immagine

but the "light" versions looks ugly, too thin and syntetic
immagine

see Libre Office Writer in comparison
immagine

font-stretch statement is not recognized and messes up the rendering

immagine

This corresponds to

* {
  color:black;
  background-color: white;
  font-family: "Segoe UI";
  font-weight: normal;
  font-stretch: condensed;
}

Roboto and other user-installed fonts are not recognized:

immagine

this corresponds to

* {
  color:black;
  background-color: white;
  font-family: "Roboto";
  font-weight: normal;
}

I believe we should report those issues in pango, I am available. Or @Nilvus you want to do it?

@Nilvus
Copy link
Contributor Author

Nilvus commented Dec 14, 2022

Thanks @Mark-64 for your feedback. I understand so that it's worse on Windows by respecting such specs. Have I understood correctly?

It would be good to share to Pango our CSS (darktable-elegant-darker.css file) with the before/after and linking to your detailed comment on that PR. Seems that something miss. Unfortunately, I can't test on Windows to better work/understand the issue. On Linux, I do not have such huge differences. I so prefer that you precise your feedback and link to my work. If needed, I can complete or answer to Pango issue (and I follow it already).

@Nilvus Nilvus added bug: wip someone is currently working on that, check with them before taking over bug: upstream he bug needs a fix outside of the scope of darktable, in an external lib or in a driver scope: windows support windows related issues and PR labels Dec 14, 2022
@Nilvus Nilvus changed the title Update fonts CSS code to respect CSS standard specs [WIP] Update fonts CSS code to respect CSS standard specs Dec 14, 2022
@Nilvus Nilvus removed this from the 4.2.1 milestone Dec 27, 2022
@Nilvus
Copy link
Contributor Author

Nilvus commented May 3, 2023

Nothing moves on Pango and Cairo issues. So closing. Could be redone and updated regarding master if this changed.

@Nilvus Nilvus closed this May 3, 2023
@Nilvus Nilvus deleted the css-font-spec branch May 3, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: upstream he bug needs a fix outside of the scope of darktable, in an external lib or in a driver bug: wip someone is currently working on that, check with them before taking over bugfix pull request fixing a bug scope: codebase making darktable source code easier to manage scope: UI user interface and interactions scope: windows support windows related issues and PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GUI] The default theme (and a few others) have problems with Cyrillic text on Windows
2 participants