Open julien-deramond opened 1 month ago
For information, a first draft is available in the implementation of #33 due to the need to test the architect with available tokens. Of course any improvements, fixes and implementations after the merge of #33 must be linked to this issue to keep consistency.
In addition, "shared" raw tokens defined in OUDSTheme
module (common to all themes) are not customisable as is in OUDS iOS and should not supposed to be because they define raw types and true values for everything, like a kind of source of truth for everyone. However any theme can define its own raw tokens and assign them to semantic tokens. Of course raw tokens values can be defined thanks to generated Swift code, if we have any efficient and relevant tools suite.
What should be done for this issue:
It seems some tokens rely on web paradigm like viewports or breakpoins, i.e. tokens with multiple values for cases "Token name Token value (col-xs-sm) Token value (col-md-lg) Token value (col-xl-2xl-3xl)".
How should we manage that for iOS / iPadOS? These logic is not used for mobile apps, maybe we can only rely on case xl/2xl/3xl.
Other topics to tackle:
There are many font families. It seems some of them are not iOS native. And others like Helvetica may rely on externala ssets to add (like woff or stuff like that). What should we do? Should we consider only native font families on iOS and let themes add their own fonts?
Not that font-weight-950 won't be implemented because SwftUI does not provide extra-black or ultra-black values (see documentation.
About letter spacing, we cannot use percentages nor floating point pixels, but points starting from 0 (see documentation). What sould we do?
In order to test our CI/CD pipeline velocity, avoid to have stale branches, have a fresh code base for documentation and test our production build (for a fake 0.0.0 version), a first version of the tokens has been merged as is, but the issue is not closed because there are some topics to deal about these typography tokens.
How should we manage font families embeded natively in iOS (e.g. San Francisco) and those which need external assets (like TTF or WOFF files)?
Are we supposed for example to have Helvetica assets for OrangeTheme
stored elsewhere?
What about missing font families (see this comment)?
Are we supposed to add "iOS" word in each of our token name? It is a non sense, we expose an iOS library, no need to repeat ourselves.
iOS with SwftUI does not expose extra-black, extra-bold, ultra-black and ultra-bold values, so should we remove these raw tokens values and not integrate fontweight-800 and fontweight-950? What should we do for any semantic token using them?
iOS with SwftUI does not manage percentages nor floating point pixels for letter spacing, only integers which should start from 0. What should we done? It could be much simple to have the suitable points values (best case), or for the worst case a kind of conversion table to convert raw tokens values to points.
### 4) Viewports
For several tokens with have three types of values for cases col-xs-sm, col-md-lg and col-xl-2xl-3xl. These notions are very "web" and do not match anything in iOS side. Should we only consider the col-xl-2xl-3xl case?
Values for font sizes, line heights and spacings here are listed in pixels, not in points. What should we do? Convert them to points? Use them as is?
What are they supposed to be?
The only API we have with SwiftUI are:
cc @B3nz01d @mccart77 @ludovic35
FYI first version delivered with commit f4ec34d3702300e24087627d2051dfc5f9387242 and released before version 0.1.0
FYI here are the available fonts with their associated font families. Some of them are not available like:
How should we also manage the San Franciso iOS default font?
for someFontFamily in UIFont.familyNames {
for someFont in UIFont.fontNames(forFamilyName: someFontFamily) {
print("\(someFontFamily) / \(someFont)")
}
}
Academy Engraved LET / AcademyEngravedLetPlain
Al Nile / AlNile
Al Nile / AlNile-Bold
American Typewriter / AmericanTypewriter
American Typewriter / AmericanTypewriter-Light
American Typewriter / AmericanTypewriter-Semibold
American Typewriter / AmericanTypewriter-Bold
American Typewriter / AmericanTypewriter-Condensed
American Typewriter / AmericanTypewriter-CondensedLight
American Typewriter / AmericanTypewriter-CondensedBold
Apple Color Emoji / AppleColorEmoji
Apple SD Gothic Neo / AppleSDGothicNeo-Regular
Apple SD Gothic Neo / AppleSDGothicNeo-Thin
Apple SD Gothic Neo / AppleSDGothicNeo-UltraLight
Apple SD Gothic Neo / AppleSDGothicNeo-Light
Apple SD Gothic Neo / AppleSDGothicNeo-Medium
Apple SD Gothic Neo / AppleSDGothicNeo-SemiBold
Apple SD Gothic Neo / AppleSDGothicNeo-Bold
Apple Symbols / AppleSymbols
Arial / ArialMT
Arial / Arial-ItalicMT
Arial / Arial-BoldMT
Arial / Arial-BoldItalicMT
Arial Hebrew / ArialHebrew
Arial Hebrew / ArialHebrew-Light
Arial Hebrew / ArialHebrew-Bold
Arial Rounded MT Bold / ArialRoundedMTBold
Avenir / Avenir-Book
Avenir / Avenir-Roman
Avenir / Avenir-BookOblique
Avenir / Avenir-Oblique
Avenir / Avenir-Light
Avenir / Avenir-LightOblique
Avenir / Avenir-Medium
Avenir / Avenir-MediumOblique
Avenir / Avenir-Heavy
Avenir / Avenir-HeavyOblique
Avenir / Avenir-Black
Avenir / Avenir-BlackOblique
Avenir Next / AvenirNext-Regular
Avenir Next / AvenirNext-Italic
Avenir Next / AvenirNext-UltraLight
Avenir Next / AvenirNext-UltraLightItalic
Avenir Next / AvenirNext-Medium
Avenir Next / AvenirNext-MediumItalic
Avenir Next / AvenirNext-DemiBold
Avenir Next / AvenirNext-DemiBoldItalic
Avenir Next / AvenirNext-Bold
Avenir Next / AvenirNext-BoldItalic
Avenir Next / AvenirNext-Heavy
Avenir Next / AvenirNext-HeavyItalic
Avenir Next Condensed / AvenirNextCondensed-Regular
Avenir Next Condensed / AvenirNextCondensed-Italic
Avenir Next Condensed / AvenirNextCondensed-UltraLight
Avenir Next Condensed / AvenirNextCondensed-UltraLightItalic
Avenir Next Condensed / AvenirNextCondensed-Medium
Avenir Next Condensed / AvenirNextCondensed-MediumItalic
Avenir Next Condensed / AvenirNextCondensed-DemiBold
Avenir Next Condensed / AvenirNextCondensed-DemiBoldItalic
Avenir Next Condensed / AvenirNextCondensed-Bold
Avenir Next Condensed / AvenirNextCondensed-BoldItalic
Avenir Next Condensed / AvenirNextCondensed-Heavy
Avenir Next Condensed / AvenirNextCondensed-HeavyItalic
Baskerville / Baskerville
Baskerville / Baskerville-Italic
Baskerville / Baskerville-SemiBold
Baskerville / Baskerville-SemiBoldItalic
Baskerville / Baskerville-Bold
Baskerville / Baskerville-BoldItalic
Bodoni 72 / BodoniSvtyTwoITCTT-Book
Bodoni 72 / BodoniSvtyTwoITCTT-BookIta
Bodoni 72 / BodoniSvtyTwoITCTT-Bold
Bodoni 72 Oldstyle / BodoniSvtyTwoOSITCTT-Book
Bodoni 72 Oldstyle / BodoniSvtyTwoOSITCTT-BookIt
Bodoni 72 Oldstyle / BodoniSvtyTwoOSITCTT-Bold
Bodoni 72 Smallcaps / BodoniSvtyTwoSCITCTT-Book
Bodoni Ornaments / BodoniOrnamentsITCTT
Bradley Hand / BradleyHandITCTT-Bold
Chalkboard SE / ChalkboardSE-Regular
Chalkboard SE / ChalkboardSE-Light
Chalkboard SE / ChalkboardSE-Bold
Chalkduster / Chalkduster
Charter / Charter-Roman
Charter / Charter-Italic
Charter / Charter-Bold
Charter / Charter-BoldItalic
Charter / Charter-Black
Charter / Charter-BlackItalic
Cochin / Cochin
Cochin / Cochin-Italic
Cochin / Cochin-Bold
Cochin / Cochin-BoldItalic
Copperplate / Copperplate
Copperplate / Copperplate-Light
Copperplate / Copperplate-Bold
Courier New / CourierNewPSMT
Courier New / CourierNewPS-ItalicMT
Courier New / CourierNewPS-BoldMT
Courier New / CourierNewPS-BoldItalicMT
Damascus / Damascus
Damascus / DamascusLight
Damascus / DamascusMedium
Damascus / DamascusSemiBold
Damascus / DamascusBold
Devanagari Sangam MN / DevanagariSangamMN
Devanagari Sangam MN / DevanagariSangamMN-Bold
Didot / Didot
Didot / Didot-Italic
Didot / Didot-Bold
DIN Alternate / DINAlternate-Bold
DIN Condensed / DINCondensed-Bold
Euphemia UCAS / EuphemiaUCAS
Euphemia UCAS / EuphemiaUCAS-Italic
Euphemia UCAS / EuphemiaUCAS-Bold
Farah / Farah
Futura / Futura-Medium
Futura / Futura-MediumItalic
Futura / Futura-Bold
Futura / Futura-CondensedMedium
Futura / Futura-CondensedExtraBold
Galvji / Galvji
Galvji / Galvji-Bold
Geeza Pro / GeezaPro
Geeza Pro / GeezaPro-Bold
Georgia / Georgia
Georgia / Georgia-Italic
Georgia / Georgia-Bold
Georgia / Georgia-BoldItalic
Gill Sans / GillSans
Gill Sans / GillSans-Italic
Gill Sans / GillSans-Light
Gill Sans / GillSans-LightItalic
Gill Sans / GillSans-SemiBold
Gill Sans / GillSans-SemiBoldItalic
Gill Sans / GillSans-Bold
Gill Sans / GillSans-BoldItalic
Gill Sans / GillSans-UltraBold
Grantha Sangam MN / GranthaSangamMN-Regular
Grantha Sangam MN / GranthaSangamMN-Bold
Helvetica / Helvetica
Helvetica / Helvetica-Oblique
Helvetica / Helvetica-Light
Helvetica / Helvetica-LightOblique
Helvetica / Helvetica-Bold
Helvetica / Helvetica-BoldOblique
Helvetica Neue / HelveticaNeue
Helvetica Neue / HelveticaNeue-Italic
Helvetica Neue / HelveticaNeue-UltraLight
Helvetica Neue / HelveticaNeue-UltraLightItalic
Helvetica Neue / HelveticaNeue-Thin
Helvetica Neue / HelveticaNeue-ThinItalic
Helvetica Neue / HelveticaNeue-Light
Helvetica Neue / HelveticaNeue-LightItalic
Helvetica Neue / HelveticaNeue-Medium
Helvetica Neue / HelveticaNeue-MediumItalic
Helvetica Neue / HelveticaNeue-Bold
Helvetica Neue / HelveticaNeue-BoldItalic
Helvetica Neue / HelveticaNeue-CondensedBold
Helvetica Neue / HelveticaNeue-CondensedBlack
Hiragino Maru Gothic ProN / HiraMaruProN-W4
Hiragino Mincho ProN / HiraMinProN-W3
Hiragino Mincho ProN / HiraMinProN-W6
Hiragino Sans / HiraginoSans-W3
Hiragino Sans / HiraginoSans-W6
Hiragino Sans / HiraginoSans-W7
Hoefler Text / HoeflerText-Regular
Hoefler Text / HoeflerText-Italic
Hoefler Text / HoeflerText-Black
Hoefler Text / HoeflerText-BlackItalic
Impact / Impact
Kailasa / Kailasa
Kailasa / Kailasa-Bold
Kefa / Kefa-Regular
Khmer Sangam MN / KhmerSangamMN
Kohinoor Bangla / KohinoorBangla-Regular
Kohinoor Bangla / KohinoorBangla-Light
Kohinoor Bangla / KohinoorBangla-Semibold
Kohinoor Devanagari / KohinoorDevanagari-Regular
Kohinoor Devanagari / KohinoorDevanagari-Light
Kohinoor Devanagari / KohinoorDevanagari-Semibold
Kohinoor Gujarati / KohinoorGujarati-Regular
Kohinoor Gujarati / KohinoorGujarati-Light
Kohinoor Gujarati / KohinoorGujarati-Bold
Kohinoor Telugu / KohinoorTelugu-Regular
Kohinoor Telugu / KohinoorTelugu-Light
Kohinoor Telugu / KohinoorTelugu-Medium
Lao Sangam MN / LaoSangamMN
Malayalam Sangam MN / MalayalamSangamMN
Malayalam Sangam MN / MalayalamSangamMN-Bold
Marker Felt / MarkerFelt-Thin
Marker Felt / MarkerFelt-Wide
Menlo / Menlo-Regular
Menlo / Menlo-Italic
Menlo / Menlo-Bold
Menlo / Menlo-BoldItalic
Mishafi / DiwanMishafi
Mukta Mahee / MuktaMahee-Regular
Mukta Mahee / MuktaMahee-Light
Mukta Mahee / MuktaMahee-Bold
Myanmar Sangam MN / MyanmarSangamMN
Myanmar Sangam MN / MyanmarSangamMN-Bold
Noteworthy / Noteworthy-Light
Noteworthy / Noteworthy-Bold
Noto Nastaliq Urdu / NotoNastaliqUrdu
Noto Nastaliq Urdu / NotoNastaliqUrdu-Bold
Noto Sans Kannada / NotoSansKannada-Regular
Noto Sans Kannada / NotoSansKannada-Light
Noto Sans Kannada / NotoSansKannada-Bold
Noto Sans Myanmar / NotoSansMyanmar-Regular
Noto Sans Myanmar / NotoSansMyanmar-Light
Noto Sans Myanmar / NotoSansMyanmar-Bold
Noto Sans Oriya / NotoSansOriya
Noto Sans Oriya / NotoSansOriya-Bold
Optima / Optima-Regular
Optima / Optima-Italic
Optima / Optima-Bold
Optima / Optima-BoldItalic
Optima / Optima-ExtraBlack
Palatino / Palatino-Roman
Palatino / Palatino-Italic
Palatino / Palatino-Bold
Palatino / Palatino-BoldItalic
Papyrus / Papyrus
Papyrus / Papyrus-Condensed
Party LET / PartyLetPlain
PingFang HK / PingFangHK-Regular
PingFang HK / PingFangHK-Ultralight
PingFang HK / PingFangHK-Thin
PingFang HK / PingFangHK-Light
PingFang HK / PingFangHK-Medium
PingFang HK / PingFangHK-Semibold
PingFang SC / PingFangSC-Regular
PingFang SC / PingFangSC-Ultralight
PingFang SC / PingFangSC-Thin
PingFang SC / PingFangSC-Light
PingFang SC / PingFangSC-Medium
PingFang SC / PingFangSC-Semibold
PingFang TC / PingFangTC-Regular
PingFang TC / PingFangTC-Ultralight
PingFang TC / PingFangTC-Thin
PingFang TC / PingFangTC-Light
PingFang TC / PingFangTC-Medium
PingFang TC / PingFangTC-Semibold
Rockwell / Rockwell-Regular
Rockwell / Rockwell-Italic
Rockwell / Rockwell-Bold
Rockwell / Rockwell-BoldItalic
Savoye LET / SavoyeLetPlain
Sinhala Sangam MN / SinhalaSangamMN
Sinhala Sangam MN / SinhalaSangamMN-Bold
Snell Roundhand / SnellRoundhand
Snell Roundhand / SnellRoundhand-Bold
Snell Roundhand / SnellRoundhand-Black
STIX Two Math / STIXTwoMath-Regular
STIX Two Text / STIXTwoText
STIX Two Text / STIXTwoText-Italic
STIX Two Text / STIXTwoText_Medium
STIX Two Text / STIXTwoText-Italic_Medium-Italic
STIX Two Text / STIXTwoText_SemiBold
STIX Two Text / STIXTwoText-Italic_SemiBold-Italic
STIX Two Text / STIXTwoText_Bold
STIX Two Text / STIXTwoText-Italic_Bold-Italic
Symbol / Symbol
Tamil Sangam MN / TamilSangamMN
Tamil Sangam MN / TamilSangamMN-Bold
Thonburi / Thonburi
Thonburi / Thonburi-Light
Thonburi / Thonburi-Bold
Times New Roman / TimesNewRomanPSMT
Times New Roman / TimesNewRomanPS-ItalicMT
Times New Roman / TimesNewRomanPS-BoldMT
Times New Roman / TimesNewRomanPS-BoldItalicMT
Trebuchet MS / TrebuchetMS
Trebuchet MS / TrebuchetMS-Italic
Trebuchet MS / TrebuchetMS-Bold
Trebuchet MS / Trebuchet-BoldItalic
Verdana / Verdana
Verdana / Verdana-Italic
Verdana / Verdana-Bold
Verdana / Verdana-BoldItalic
Zapf Dingbats / ZapfDingbatsITC
Zapfino / Zapfino
⚠️ On hold until https://github.com/Orange-OpenSource/ouds-ios/issues/33 is resolved
Description
The aim of this issue is to study and implement the typography tokens taking into account the cohesive multi-platform approach, the customization by libraries inheriting OUDS iOS, but also what we're using for OUDS iOS: Swift UI, etc.
Reminder: there will be in the end 3 layers of tokens:
Tokens: Typography
Raw primitive values
Font
Family
Weight
Size
Line-height
Letter spacing (%)
Letter spacing (px)
Paragraph spacing
Typography (Composite)
Semantic applications
Font
Family
Weight
Size
Line-height
Letter-spacing
Paragraph-spacing
Typography (Composite)
Display
Heading
Body
Label
Code
Study
Technical details
TODO