-
Notifications
You must be signed in to change notification settings - Fork 560
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
fontType property on TextBlock #1078
Comments
Final spec needed. Also, hosts should be able to define different font sizes for each font in host config, since Consolas 11pt looks bigger than Segoe UI 11pt font. |
Looks good for me overall. Only thing is I'm no fan of the term "display" - whether you use the default, display or monospace font styles, they are all for "display". I suggest we go for something like "alternate" or similar. |
Agreed - maybe "statistic"? Since that's what it's typically used for? |
Display is an existing term in type design, alongside "text" fonts. The opposite to Monospaced is Proportional fonts |
Do we want a warning(s) in some cases where inheritance goes into action. So far I've thought about the following cases and results:
Also, do we want multiple warnings to occur from the same issue? |
Good point! I suppose avoiding multiple warnings would be nice, but not too critical. We definitely should have those warnings! |
Are we still going with "display"? I would really prefer "monospace" to make it super clear that's what it is. Authors that will use that style need to know that the host will use a monospace font, given that type of scenarios (e.g. simple tables) this is for. |
@dclaux the font Bing wants is NOT monospace (I measured it) |
That Bing example uses a Serif font while the normal text is Sans Serif As most platforms do not offer both a Sans and Serif version of their UI fonts, if you wanted to include a Monospace, Proportional Sans and a Proportional Sans Serif as font styles, then that is extra work for the Host Config in the chosen platform renderer. Georgia is available on most platforms, that is a Serif type family. Microsoft uses Consolas for its go to Monospace font. |
Sorry, there was some confusion on my side here. I thought we were doing this solely for monospace font support, I didn’t realize for some reason that we also were talking about allowing an alternate font. I am not a huge fan of allowing that alternate font style (I know my designer won’t like it at all). I suppose I could live with it, but honestly the sole example provided hardly justifies it imo. I would suggest not doing it until we can gather more evidence that it is actually needed. If we are going to do it, I would use the term “alternate” rather than “display” or whatnot to emphasize that card authors shouldn’t expect this font to be anything in particular. I would also say that we should probably never offer serif vs sans serif font styles as that would have the potential of letting authors create very ugly cards.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Martin Anderson <[email protected]>
Sent: Wednesday, October 3, 2018 3:34:49 PM
To: Microsoft/AdaptiveCards
Cc: David Claux; Mention
Subject: Re: [Microsoft/AdaptiveCards] Spec: fontStyle property on TextBlock (#1078)
That Bing example uses a Serif font while the normal text is Sans Serif As most platforms do not offer both a Sans and Serif version of their UI fonts, if you wanted to include a Monospace, Proportional Sans and a Proportional Sans Serif as font styles, then that is extra work for the Host Config in the chosen platform renderer. Georgia is available on most platforms, that is a Serif type family. Microsoft uses Consolas for its go to Monospace font.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FAdaptiveCards%2Fissues%2F1078%23issuecomment-426826142&data=02%7C01%7Cdclaux%40microsoft.com%7C4a700c582aef4f55768d08d629806e01%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636742028911673085&sdata=%2B%2FaJ4QuexOhD3xJwrhuqVvsbD9cgDEVMy44WaZC9SVQ%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABRdoTc9dH-wZynxaRw0yQGwrO4zPYnFks5uhTuJgaJpZM4Rgm4s&data=02%7C01%7Cdclaux%40microsoft.com%7C4a700c582aef4f55768d08d629806e01%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636742028911683094&sdata=s24FHFt3y8GDQTeUwOptTGFduB5NFibBSwR%2Flvn3gJk%3D&reserved=0>.
|
@matthidinger to speak to the priority of the Bing "display" font feature request. I like the term Outlook (and other hosts) don't have to provide an |
While it is true that host don’t necessarily have to provide an alternate font, if they don’t they run the risk of developers complaining for a bug that isn’t one, eventually forcing the host to support the alternate style. Let’s hear from Matt and Bing, but I do believe we need much stronger evidence than the one screenshot provided. It seems to me that using the default font in that card would be a more than acceptable compromise.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Andrew Leader <[email protected]>
Sent: Wednesday, October 3, 2018 4:11:34 PM
To: Microsoft/AdaptiveCards
Cc: David Claux; Mention
Subject: Re: [Microsoft/AdaptiveCards] Spec: fontStyle property on TextBlock (#1078)
@matthidinger<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmatthidinger&data=02%7C01%7Cdclaux%40microsoft.com%7C27dd520227f64e3d4a0508d629859028%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636742050958951032&sdata=%2FESrNZULsg4vzeg%2BfN48h4KEGGA3v0l6SVStK9hwdak%3D&reserved=0> to speak to the priority of the Bing "display" font feature request.
I like the term alternative, although it's not very semantic, alternative could actually be less prominent. What they're trying to achieve is a more prominent font. Maybe featured or something. I also suggested statistic, since this is typically used when displaying statistics.
Outlook (and other hosts) don't have to provide an alternative font. They could always have it use the normal font, just like they don't have to provide a monospace font either.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FAdaptiveCards%2Fissues%2F1078%23issuecomment-426833425&data=02%7C01%7Cdclaux%40microsoft.com%7C27dd520227f64e3d4a0508d629859028%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636742050958951032&sdata=N2a3Ov0QJtP6rg2tWLvTMZ6Er6WSKzrwNNcqhCECs0I%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABRdoQnTsxM65u22Zvbd45ORi7nzq8vuks5uhUQmgaJpZM4Rgm4s&data=02%7C01%7Cdclaux%40microsoft.com%7C27dd520227f64e3d4a0508d629859028%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636742050958961046&sdata=ewNXu6c7iNRf2UjiO0bObFBiYP8x370Rj6nqm%2Fmkwm8%3D&reserved=0>.
|
Can we close on this? I still have the same concerns about the "display" font:
About the monospace font style - it is supposed to help create simple tables or code blocks. But Markdown collapses consecutive spaces. So we have two choices:
If we were to do the latter, then there would be no remaining reason to support fontStyle on TextBlock. |
@matthidinger to speak towards whether Bing needs a "display" (or whatever we choose to call it) font for 1.2. An alternative could be that Bing uses extensibility, but we did already approve the proposal to add two font styles (monospace and display). I'm happy to find a better name for it! Or if Bing doesn't need it (or can use extensibility), I'm happy to cut it! For the monospace concern, we could add the |
I am fine with the @matthidinger looking to hearing from you about the need for a "display" font. Adding this just for Bing and for that particular scenario doesn't feel right to me. |
Consensus was to remove the |
Spec changes from meeting today with Andrew, Becky, David, and Mike DECISION: Rename to Card authors send... {
"type": "TextBlock",
"text": "Text to display",
"weight": "bold",
"size": "large",
"fontType": "default | monospace", // New property
} Hosts in HostConfig specify {
"fontTypes": {
"default": {
"fontFamily": "Segoe UI, Tahoma, Geneva, Verdana, sans-serif",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
},
"monospace": {
"fontFamily": "Consolas",
"fontSizes": {
"small": 11,
"default": 13,
"medium": 16,
"large": 19,
"extraLarge": 24
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
}
}
} For record purposes, other options we considered... Call it
|
Implemented here: #2905 |
* Create Image.md * Update Image.md * Update Image.md * More specs * Media element * Trying to get auto generate working * Closer! * [Schema] Document data URI Feature spec #628 * [Schema] Introduce inlineAction Original spec #147 * Specs auto-generated! * [Schema] Add ActionSet Spec #877 * Include marked-schema locally * Improve formatting of markdown table * [Schema] Update version description Make description for version attribute a little more clear about being required for toplevel cards. Fixes #2958 * [Schema] Add fontType to TextBlock Spec #1078 * [Schema] Add wrap to ChoiceSet and Toggle Spec #1887 * Move spec generation to separate module * Standalone spec generator script * Auto-update specs on save * Add some readme's * Spec updating readme * Point people to the readme * 1.2 features * Move Adaptive Card rendering into the actual spec file * Started adding action specs * Generate host config * More action info * More ActionSet details * Mock renderer statuses * Finished with actions * Columns * Start adding backgroundImage * Started working on schema-with-types * Testing infrastructure * Add URI support * Add required support * Refactor to class * Add type references * Add extending classes * Add inehritance with referencing base class * Support multiple types for single property * Add arrays * Add tests for arrays of base types * Add dictionary support * Generate typed schema schema from typed schema itself * Add typed schema schema * Add booleans * Disallow additional properties * Add extends and schema to json schema * Started updating some of the schema * Support multiple top-level types and other fixes * Fix not being able to add properties to extended classes * Add ability to change property name of type property * Support having a default type that doesn't need type specified * New classType schema * Add ContainerStyle enum * Add VerticalContentAlignment * Support default and required in schema * Support any object type * Update schemas * Add nullable * Add any arrays * Update schemas * Add shorthands * Start writing more schema * Allow type to not be specified at top level * Infer type names from file name * Add more schema * Add marker interfaces * More elements * Support recursive directories * Rename to typed-schema * Report more useful errors * Start generating Adaptive Card schema * Support enums * Schema starting to work! * Fix incorrect container property * Fix extended classes not allowing extended properties * Rename to src folder * Adding columns * Closer to multiple tiers of extending * Support multiple inheritance * Throw errors on unknown types * Rename to BlockElement * Add FactSet * Add ImageSet * Add Input.Text * Added all inputs * Add typed classes for the parser * Create overall Schema type object * Support loading schema from folder * Almost got spec generation working with new format! * Add ActionSet * Markdown generation is getting there! * Markdown generation almost done * Generate enum specs * Add enum value description support * Add shorthand property to classes * Update schema to support shorthand * Update schema file * Include lib * Updated schema * Add RichTextBlock * Re-organize * Change image uris to strings for relative urls * Add Style property to Card * Add Action.ToggleVisibility * Add style to actions * Remove duplicative BlockElement properties * Add fallback * Update wrap property on inputs * Generated * Update Input.Text selectAction * Generate * Add some versions * Fix blank allOf * Added a test that tests our samples * Add horizontalAlignment to richtextblock * Add minHeight * Add minHeight to AdaptiveCard * Add isVisible * Update package-lock.json * Add verticalContentAlignment to Adaptive Card * Add height to container and columnset * Add height to Column * Add height to all elements * Support overriding properties * Fix image height property * Fix overriding of inherited properties * Update adaptive-card-new.json * Make Column.items not required * All samples valid * Use uri-reference * Support allowAdditionalProperties * Allow custom enums * card.style version = 1.2 * Include build-model * Correctly display version number in markdown * Support shorthands in markdown and fix background image version * Remove generate-specs from website * Generating site from new schema partially working * Site generating properties * Fix schema literals in website properties * Make inherited detailed properties appear, and fix examples for properties * Make type appear correctly on markdown tables * Update toc * Add new elements * Re-order version property * Show type type in type * Support displaying enum value versions * Style the default value correctly * Indicate that type on inlines is required * Support inline shorthand * Improve image size documentation * Fix inlineAction description * Surface required properties at top of table * Remove local marked-schema * Rename BlockElement to Element * Dispaly uri-reference as uri * Rename fonttype sample * Add expense report example * Update schema file in sample * Update ExpenseReport to use Submit * Support case insensitive enums * Remove generated adaptive card schema * Make release build schema * Remove compiled typed-script schema * Add instruction for generating Adaptive schema * Remove spec-generator * Update samples schema test to use correct payload * Remove specs * Support multiple schema versions * UWP test updates for renamed FontType test * Typo in UWP test app * Update UWP tests after sample payloads changed * Add FontType expected tests * Add readme for schema * Update Visualizer to reference new schema file and all samples * Fix iOS referencing old FontTypes payload
✔️ Android (#1964)
✔️ iOS (#1965)
✔️ TS (#2430)
✔️ UWP (#1963)
Solves requests
would be a huge amount of bloatSolution
Add an additional
fontType
property to TextBlocks, with configurable fonts for each possiblefontType
value in host config. Monospace blocks of text can be achieved by using a container with emphasis style.Schema
New property on
TextBlock
FontType
Markup:
Why "fontType"?
style
since we might want to usestyle
for something elsetextStyle
since can imagine this font style being useful in other places, like Actions, where the text property is calledtitle
rather thantext
, sofont
is applicable to both.fontStyle
since in HTML/UWP/Android, fontStyle (or textStyle) is used for italic/bold, not font familiesfontFamily
for reasons specified in a comment belowfont
since font is supposed to be a collection of fontFamily + size + weightsHost Config
Add new
fontTypes
property, which allows defining the font type for each type. Inside each, can set thefontFamily
, and also the font sizes, since different fonts may appear larger or smaller. Can set font weights for same reason.If some properties on a style aren't specified, inherits the properties from the default style.
Deprecate existing
fontFamily
,fontSizes
, andfontWeights
properties in exchange for the newfontTypes
.If a host didn't provide the
default
style but provided the old deprecated properties, those old deprecated properties should be utilized as thedefault
style (and those should be inherited to other styles that also aren't specified).Down-level impact
Low. Text appears and displays pretty well. It simply doesn't have the correct font family.
Host burden
Medium. Changes in structure of host config.
Renderer Requirements
fontTypes.[specifiedStyle].[property]
value exists, use its valuedefault
, see if thedefault
has a value for thatAuto-generated task status
The text was updated successfully, but these errors were encountered: