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

TextBlock add Monospace property #398

Closed
6 tasks
matthidinger opened this issue Jun 7, 2017 · 4 comments
Closed
6 tasks

TextBlock add Monospace property #398

matthidinger opened this issue Jun 7, 2017 · 4 comments

Comments

@matthidinger
Copy link
Member

matthidinger commented Jun 7, 2017

Implementation status

  • .NET
  • Android
  • iOS
  • TypeScript
  • UWP
  • Documentation

Problem

There's no way to display console output, ascii art 😜, etc

Example Comps

image

Asks

  • High-priority Teams team ask

Proposal: Use Markdown

Simply add support for Markdown code blocks?

{
  "type": "TextBlock",
  "text": "```
Error: Missing , on line number 5
```",
  "wrap": true
}

Spec Changes

Markdown support expands to code blocks (but no syntax highlighting)

Host Config

Add monospaceFontFamily to host config...

{
	"choiceSetInputValueSeparator": ",",
	"supportsInteractivity": true,
	"fontFamily": "Segoe UI",
        "monospaceFontFamily": "Consolas"

Renderer Requirements

  • A renderer MUST at least understand the ``` markdown syntax and not display the ticks to the user (it'd be acceptable to display the content without monospace font, but that's not ideal)
  • A renderer SHOULD display the ``` content within a styled block, using the monospace font
    • If monospaceFontFamily is specified in host config, renderer should use that font family
    • Otherwise, renderer should default to a reasonable font family (like Consolas)

Downlevel Impact

Medium - Users see odd ``` but otherwise not a big deal, they still see the content

Proposal: Use TextStyle

Simply add TextStyle to TextBlock with a monospace option? Related to solution of fonts for text: #1078

{
  "type": "TextBlock",
  "text": "Error: Missing , on line number 5",
  "textStyle": "monospace",
  "wrap": true
}

To achieve a border/background, the author could wrap this in a container with emphasis enabled.

Depending on how we build it, we could also use this to enable inline fonts, similar to the last proposal on inline colors: #1079

Spec Changes

Addition of textStyle property on TextBlock (with values of default and monospace

Host Config

Add monospaceFontFamily to host config...

{
	"choiceSetInputValueSeparator": ",",
	"supportsInteractivity": true,
	"fontFamily": "Segoe UI",
        "monospaceFontFamily": "Consolas"

Renderer Requirements

  • A renderer SHOULD understand the textStyle and display the text using the monospace font
    • If monospaceFontFamily is specified in host config, renderer should use that font family
    • Otherwise, renderer should default to a reasonable font family (like Consolas)

Downlevel Impact

None - Users see the content, but it simply isn't monospace (same as today)

@mdtauk
Copy link

mdtauk commented Jun 7, 2017

How would you handle the chosen font?

@matthidinger matthidinger added this to the v1 milestone Jul 6, 2017
@matthidinger matthidinger modified the milestone: v1 Aug 8, 2017
@matthidinger
Copy link
Member Author

@mdtauk each platform renderer would either choose a default if possible, otherwise (and probably in addition to) we would add a HostConfig option to allow hosts to specify their monospace font of choice

@matthidinger matthidinger added this to the v1.1 milestone Aug 14, 2017
@khouzam khouzam removed this from the v1.1 milestone Nov 30, 2017
@andrewleader
Copy link
Contributor

Concerns about using markdown (costly to implement, etc), other proposal seems easier. Teams, however, would like to see both options work. Need to flush out proposal more to see which option to go with.

@andrewleader
Copy link
Contributor

Closing in favor of #1078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants