gtk-flutter / adwaita

Implementation of the adwaita theme for flutter/dart
https://pub.dev/packages/adwaita
Mozilla Public License 2.0
37 stars 8 forks source link

Follow typography guidelines #12

Closed pablojimpas closed 2 years ago

pablojimpas commented 2 years ago

Typography is really important for the look and feel of UIs.

If we want to build accurate GNOME style apps this Adwaita theme should follow HIG Guidelines on Typography closely. Specifically they use the Cantarell font, I think it is included in the google_fonts package although adding such a big dependency for a small feature seems bloated, it will be better to include it manually, here is Cantarell's official page.

MalcolmMielle commented 2 years ago

The guideline says the Wherever possible, use the default system fonts as provided by the distribution or operating system on which your application is running. This would mean that in android and ios we don't want to change the font to Cantarell.

I have no idea how fonts are handled in flutter for desktop, on the other hand. Would you have the time to check that out and see if it follows the system's default already? I'm under the impression that the Ubuntu people do not need to handle that in their yaru package

pablojimpas commented 2 years ago

Flutter apps use the default font provided by the engine, they don't follow system's default font. https://github.com/flutter/flutter/issues/48381

It seems like Ubuntu's Yaru theme provides it's own font family: https://github.com/ubuntu/yaru.dart/tree/main/lib/src/text

I think we could do something similar in this package with Cantarell since it is GNOME default font regardless of the guidelines saying that apps should follow the default system theme since Flutter doesn't support that for now.

MalcolmMielle commented 2 years ago

Yep good catch I missed that earlier. Would be ok with sending a PR doing that? It would be awesome!

pablojimpas commented 2 years ago

Okay, If I have time later today I will implement something similar to Yaru's approach to see how it looks.

prateekmedia commented 2 years ago

1:1 Typography is coming in v0.5.0 image

prateekmedia commented 2 years ago

I think this can be closed now as typography is 1:1, @pablojimpas what do you think?

pablojimpas commented 2 years ago

I think this can be closed now as typography is 1:1, @pablojimpas what do you think?

Nice, I've checked the latest commit and it looks great! At least for now this is more than okey...when I started looking to implement this I entered in a rabbit hole looking for a future-proof implementation given that Material 3 spec changes typography.

Related: https://github.com/flutter/flutter/issues/89853