Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ousnius
Copy link
Contributor

@ousnius ousnius commented Sep 20, 2025

See header https://gitlab.gnome.org/GNOME/pango/-/blob/main/pango/pango-font.h#L261

  • Pango.Constants.XX_SMALL
  • Pango.Constants.X_SMALL
  • Pango.Constants.SMALL
  • Pango.Constants.MEDIUM
  • Pango.Constants.LARGE
  • Pango.Constants.X_LARGE
  • Pango.Constants.XX_LARGE

Other wrappers like GtkSharp or Vala have also introduced these as custom code.
e.g. https://gitlab.gnome.org/GNOME/vala/-/blob/main/vapi/metadata/Pango-1.0-custom.vala

  • I agree that my contribution may be licensed either under MIT or any version of LGPL license.

@badcel
Copy link
Member

badcel commented Sep 20, 2025

I wonder why the constants are not generated?

See: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/567

@badcel
Copy link
Member

badcel commented Sep 21, 2025

Can you please put the calculation into the code, instead of the result? It will still be a constant expression and the compiler will use full precission for calculations.

@ousnius
Copy link
Contributor Author

ousnius commented Sep 21, 2025

Can you please put the calculation into the code, instead of the result? It will still be a constant expression and the compiler will use full precission for calculations.

0.5787037037037 -> 0.5787037037037037
0.6944444444444 -> 0.6944444444444444
0.8333333333333 -> 0.8333333333333334

@badcel
Copy link
Member

badcel commented Sep 21, 2025

Can you squash and it's good to go πŸš€.

See header pango-font.h

* Pango.Constants.XX_SMALL
* Pango.Constants.X_SMALL
* Pango.Constants.SMALL
* Pango.Constants.MEDIUM
* Pango.Constants.LARGE
* Pango.Constants.X_LARGE
* Pango.Constants.XX_LARGE

Change Pango scale factors to expressions for full precision

Example values:
0.5787037037037 -> 0.5787037037037037
0.6944444444444 -> 0.6944444444444444
0.8333333333333 -> 0.8333333333333334
@ousnius ousnius force-pushed the pango-scale-factor-constants branch from 8ea19c7 to 91fdfeb Compare September 21, 2025 09:42
@badcel badcel merged commit a044850 into gircore:main Sep 21, 2025
3 checks passed
@ousnius ousnius deleted the pango-scale-factor-constants branch September 21, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants