{"action":"created","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/224","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/224/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/224/events","html_url":"https://github.com/flutter/flutter/issues/224","id":115974735,"number":224,"title":"Text API","user":{"login":"FlutterIssues","id":15744020,"avatar_url":"https://avatars1.githubusercontent.com/u/15744020?v=4","gravatar_id":"","url":"https://api.github.com/users/FlutterIssues","html_url":"https://github.com/FlutterIssues","followers_url":"https://api.github.com/users/FlutterIssues/followers","following_url":"https://api.github.com/users/FlutterIssues/following{/other_user}","gists_url":"https://api.github.com/users/FlutterIssues/gists{/gist_id}","starred_url":"https://api.github.com/users/FlutterIssues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlutterIssues/subscriptions","organizations_url":"https://api.github.com/users/FlutterIssues/orgs","repos_url":"https://api.github.com/users/FlutterIssues/repos","events_url":"https://api.github.com/users/FlutterIssues/events{/privacy}","received_events_url":"https://api.github.com/users/FlutterIssues/received_events","type":"User","site_admin":false},"labels":[{"id":283479235,"url":"https://api.github.com/repos/flutter/flutter/labels/new%20feature","name":"new feature","color":"ffff00","default":false},{"id":284438921,"url":"https://api.github.com/repos/flutter/flutter/labels/prod:%20engine","name":"prod: engine","color":"003570","default":false},{"id":284437560,"url":"https://api.github.com/repos/flutter/flutter/labels/prod:%20framework","name":"prod: framework","color":"207de5","default":false},{"id":283479178,"url":"https://api.github.com/repos/flutter/flutter/labels/prod:%20text%20input","name":"prod: text input","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/flutter/flutter/milestones/1","html_url":"https://github.com/flutter/flutter/milestone/1","labels_url":"https://api.github.com/repos/flutter/flutter/milestones/1/labels","id":1402982,"number":1,"title":"Stretch Goals","description":"This milestone is for features and bugs we do not intend to address before releasing 1.0, but that we want to address soon after.\r\n\r\nThe date on this milestone is utterly arbitrary and just intended to sort the milestone appropriately.","creator":{"login":"FlutterIssues","id":15744020,"avatar_url":"https://avatars1.githubusercontent.com/u/15744020?v=4","gravatar_id":"","url":"https://api.github.com/users/FlutterIssues","html_url":"https://github.com/FlutterIssues","followers_url":"https://api.github.com/users/FlutterIssues/followers","following_url":"https://api.github.com/users/FlutterIssues/following{/other_user}","gists_url":"https://api.github.com/users/FlutterIssues/gists{/gist_id}","starred_url":"https://api.github.com/users/FlutterIssues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlutterIssues/subscriptions","organizations_url":"https://api.github.com/users/FlutterIssues/orgs","repos_url":"https://api.github.com/users/FlutterIssues/repos","events_url":"https://api.github.com/users/FlutterIssues/events{/privacy}","received_events_url":"https://api.github.com/users/FlutterIssues/received_events","type":"User","site_admin":false},"open_issues":310,"closed_issues":1349,"state":"open","created_at":"2015-11-09T20:19:58Z","updated_at":"2018-04-17T23:42:52Z","due_on":"2030-12-31T08:00:00Z","closed_at":null},"comments":8,"created_at":"2015-11-09T21:48:34Z","updated_at":"2018-04-20T20:33:17Z","closed_at":null,"author_association":"NONE","body":"<a href=\"https://github.com/Hixie\"><img src=\"https://avatars.githubusercontent.com/u/551196?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [Hixie](https://github.com/Hixie)**\n_Sunday Oct 25, 2015 at 00:24 GMT_\n_Originally opened as https://github.com/flutter/engine/issues/1774_\n\n---\n\nText consists of a series of glyphs from one or more fonts. Each series of glyphs that uses a specific font is placed in a box. The boxes are all aligned along a common baseline, which is either the alphabetic baseline (e.g. for English text), the ideographic baseline (e.g. for CJK characters), the hanging baseline (e.g. for Thai), or the mathematical baseline. The boxes have several heights: the em height (the font size), the line height (the font size times the line height factor for that box), the font box height, and the bounding box height (see note 2). The line height is positioned such that it has the same difference from the em height above and below the baseline. The boxes are line-wrapped and placed vertically below each other. The text origin is the point at the start (i.e. before the first character) of the first line, on the chosen baseline. \n\nWe should expose the following inputs for the text painting and layout algorithm:\n- [x] font size (in pixels), weight (100, 200, 300, ... 900), whether it should be italicised, whether a small-caps variant should be chosen, text decoration style (zero or more of underline, overline, linethrough), text decoration color, text decoration style (solid line, wavy line, etc). *\n- [ ] the Paint to use when drawing the text. *\n- [ ] a way to change the Paint efficiently (e.g. change colour without a new layout).\n- [ ] the line height, as a multiple of the font-size. *\n- [ ] whether or not this span's line height should contribute to the line's actual height calculations. Defaults to false except for the outermost box where it's always true. *\n- [ ] a list of font family names, in preference order. *\n- [ ] the chosen dominant text direction (ltr, rtl, same-as-parent-default-ltr, same-as-parent-default-rtl). *\n- [ ] whether to enable the bidi algorithm inside this span, or whether to force all text to be in the given direction (\"bidi override\") *\n- [ ] whether to isolate this span from any parent span, treating it as if it didn't have a parent for bidi purposes, and ignoring this span's bidi settings for the purposes of the parent's bidi algorithm (\"bidi isolate\"). \\* See note 4 below.\n- [ ] the type of CJK ideographs to use (traditional Chinese, simplified Chinese, Korean, Vietnamese, Japanese), when a codepoint corresponding to a CJK unified ideograph is used. *\n- [x] the text to show, and any nested text boxes with other styles. *\n- [ ] the baselines and vertical-alignment offset to use for box alignment (e.g. \"align the alphabetic baseline a superscript offset from the parent's alphabetic baseline\", or \"align the ideographic baseline 20 pixels down from the parent's hanging baseline\"). *\n- [ ] the baseline to use for the text origin.\n- [ ] font registration API, as per https://github.com/flutter/engine/blob/master/sky/specs/fonts.md\n- [ ] width at which to soft wrap (wrap before this point if there is an available line break opportunity).\n- [ ] width at which to hard wrap (wrap before this point regardless of available line break opportunities).\n- [ ] the width to use for centering and right-alignment; by default, if it's not set, then it should use the soft-wrap-width, or if that's not set, the hard-wrap-width, or if that's not set, the intrinsic max width. (Right now, there are minWidth and maxWidth properties. As far as I can tell, minWidth is useless, and maxWidth is just the actual width, except it has a crazy default (infinity?) so if you center text without setting a maxWidth, it disappears (many kilometers to the right of your screen, probably).)\n- [ ] the dimensions of placeholders in the text.\n\nThe input consists of a tree of boxes annotated with the data marked with asterisks \\* in the list above. The baselines of the outermost box set the metrics to use for baseline alignment. On each line, the boxes are positioned vertically according to the settings, and then those that contribute their line height are examined. The distance from one line to the next is the distance from the baseline of the first, to the bottom of the bottommost line height box on that line, plus the distance from the top of the topmost line height box on the next line, to the baseline of that second line. \n\nWe should expose the following metrics for text:\n- [ ] whether the text origin is on the right (e.g. arabic, hebrew) or on the left (e.g. latin, cyrillic). This corresponds to the configured text direction. (automatic direction detection would be done at the Dart layer)\n- [ ] advance width of the entire text relative to text origin, as if the text was not wrapped. (a positive number, regardless of text direction)\n- [ ] advance width from the origin to the end of the glyph to which the character at a particular index corresponds (or codepoint, if we're using UTF-16, or byte, for UTF-8...), as if the text was not wrapped. See note 1 below.\n- [ ] number of lines.\n- [ ] vertical distance from the text origin to the chosen common baseline of each subsequent line.\n- [ ] advance widths of each line. See note 1 below.\n- [ ] advance width from the start of the line to the end of the glyph to which the character at a particular index corresponds.\n- [ ] line number for the glyph to which the character at a particular index corresponds.\n- [ ] direction of text at the end of the glyph to which the character at a particular index corresponds. See note 1 below.\n- [ ] index of last character corresponding to the glyph closest to a particular Offset from the text origin.\n- [ ] distance from the text origin to the left edge of the actual bounding box of the text. See note 2 below.\n- [ ] distance from the text origin to the right edge of the actual bounding box of the text. See note 2 below.\n- [ ] distance from the text origin to the top edge of the actual bounding box of the text. This corresponds to the first line's actual bounding box ascent.\n- [ ] distance from the text origin to the bottom edge of the actual bounding box of the text. If the text does not wrap, this corresponds to the actual bounding box descent. Otherwise, it's the last line's actual bounding box descent plus the distance from the first line's baseline to the last line's baseline.\n- [ ] max font box ascent relative to baseline. This is the distance from the chosen baseline to the top of the font box of the font with the highest font box amongst all the fonts used. See note 3.\n- [ ] max font box descent relative to baseline. This is the distance from the chosen baseline to the bottom of the font box of the font with the lowest font box amongst all the fonts used. See note 3.\n- [ ] the distance from the baseline to the top of the em box of the highest font box (the em height ascent).\n- [ ] the distance from the baseline to the bottom of the em box of the lowest font box (the em height descent).\n- [ ] the upwards distance from the chosen baseline to the various other baselines (alphabetic, ideographic, hanging, mathematical).\n- [ ] the precise positions of placeholders in the resulting output.\n\nNote 1: Because of bidi, the \"end\" of a character could be on the left or the right. For example, for \"bب\", if both characters are 10 units wide, and the configured text direction is ltr, the advance widths would be 10 and 10, even though the advance width of the whole string would be 20. The direction at the end of each character would be \"ltr\" and \"rtl\" respectively. If the string was wrapped in between the two characters, the line-specific advance width for the second line's first character would be 0, and both lines would have an advance width of 10 (the total advance width would still be 20).\n\nNote 2: Each font has a font bounding box, which is the space the font would need to render the character that reaches the highest and the character that reaches the lowest. A specific span of text has a bounding box that is usually smaller than this (because most text doesn't include the extreme characters). If the text is a single period, it's much smaller than if it's a lowercase \"o\", which would itself be much smaller than if the text was an uppercase \"F\". Some fonts have particular characters that on their own will wildly increase the bounding box dimensions (e.g. Zapfino's lowercase \"f\").\n\nNote 3: The fonts used depends on the characters used. If the text only consists of the letter \"a\", then it'll all be from the same font. If the text is \"a林\" then it might come from two fonts, one with latin characters and one with ideographic characters. However, the font box height given a particular set of fonts is independent of the actual characters. That is, if \"a\" and \"b\" end up using the same font, then they have the same font box dimensions (but probably different actual bounding box dimensions).\n\nNote 4: We don't need to support bidi embeddings. Those can be done using explicit bidi formatting characters. We don't need to support the equivalent of \"unicode-bidi: plaintext\", that can be implemented at the Dart level.\n"},"comment":{"url":"https://api.github.com/repos/flutter/flutter/issues/comments/383214407","html_url":"https://github.com/flutter/flutter/issues/224#issuecomment-383214407","issue_url":"https://api.github.com/repos/flutter/flutter/issues/224","id":383214407,"user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars2.githubusercontent.com/u/551196?v=4","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"created_at":"2018-04-20T20:33:17Z","updated_at":"2018-04-20T20:33:17Z","author_association":"CONTRIBUTOR","body":"Yeah, we haven't really begun on it."}}
{"actor":{"display_login":"Hixie"}}