Skip to content

Text schema-level feedback #57

@tcauchois

Description

@tcauchois

Hi all,

I've got some notes on the Autodesk text proposal. This issue is specifically focused on USD schema issues; I'm planning to file another issue about the hydra implementation. Hoping some text-knowledgeable folks can sanity check this but some things that jumped out at me:

Feedback on SimpleText:

  • I was surprised to see textMetricsUnit as a member of SimpleText, and textHeight as a member of TextStyle. These seem like they want to be authored on the same prim. Assuming that a standard scene will have SimpleText with no TextStyle (i.e. renderer's choice) or a bunch of text pointing at the same TextStyle, it seems like of the things to vary across text prims, textHeight is maybe the most likely?
  • renderer seems like an implementation detail that's not appropriate at this level of schema. I like the idea of delegating text -> geometry transformations to a plugin, to make it easier to integrate with the local text library, but that seems like something that should be resolved at build time, not at per-prim processing time. It's possible I'm missing something here, though?
  • For completeness, we should list the relationships here to a TextStyle prim, TextLayoutPrim, etc.

Feedback on TextStyle:

  • fontType, once again, seems like an implementation detail that doesn't belong at this level of schema. Given the text implementations we've compiled against and the font search paths, we should choose the right font file based on the "typeface" parameter. If the choice involves other elements of TextStyle, or something about how we're rendering, those choices can drive the font selection.
  • A question for more text-knowledgeable folks: are bold and weight redundant, or is it pretty standard to expose both? I appreciate that the proposal discusses how to resolve between them.
  • textWidthFactor/charSpacing: more consistent naming would be great here, maybe charWidthFactor and charSpacingFactor?

Feedback on TextLayout:

  • direction isn't really adequate for internationalization; is it still worth having on SimpleText? It seems more useful for writing latin fonts in weird directions for engineering diagrams or something, but really using a text layout engine is the correct answer. Assuming you're not using a text layout engine, I'm assuming that we have a super simplistic layout engine which can draw the characters in neutral orientation but then move the curser right/left/up/down for the next character; if this is the intention, "defaultDir" is a bit of a trap because it requires layout knowledge of different scripts, which is precisely the thing we'd like to avoid here (seemingly).

Are TextStyle and TextLayout prims that SimpleText has a relationship to, or API schemas? It's unclear from the proposal. It seems likely to encounter a scene with a lot of text using the same styling, so making TextStyle a separate prim lets the scene define a global TextStyle and refer all of its SimpleText prims to that style, which seems appealing.

Feedback on MarkupText:

  • The core concept here is text with multiple styles and some consideration to layout. Markup seems like an implementation, and MultilineText or LayoutText or something seems like a more appropriate name. Then markup becomes textData and markupLanguage becomes layoutMethod or something, with values including "plaintext" and "mtext".
  • Same notes about textHeight and renderer.

Feedback on ColumnStyle:

  • offset: columnOffset, for consistency?
  • margins: what order are these in?
  • blockAlignment: verticalAlignment seems like a more understandable name.
  • direction/lineFlowDirection: first of all, these are confusing names. Could you have characterDirection and lineDirection to distinguish between them? These also seem like weird additions to ColumnStyle, and a better fit for TextLayout or MultilineTextLayout or something. I'd also imagine you'd want an option to let a layout engine handle both.
  • In order to have multiple columns, you either need MarkupText to have a relationship to one-or-more column prims, or you need a multi-apply ColumnStyle API schema. It seems tidy to be able to use a multi-apply schema to define the columns right on the text prim (since they are probably intrinsically linked to the text contents and not shareable); and then have a MarkupText attribute columnOrder that lists the instance names in order.

Feedback on ParagraphStyle:

  • leftIndent, rightIndent: are these redundant with ColumnStyle margins?
  • paragraphAlignment: horizontalAlignment?
  • Same notes about MarkupText having a relationship to multiple ParagraphStyles or having a multi-apply ParagraphStyleAPI schema and an ordering attribute. I like the API schemas here and for ColumnStyle since I view this formatting as logically part of the text data, as opposed to TextStyle which might be shared by many text primitives.

Thanks!
Tom

Metadata

Metadata

Assignees

No one assigned

    Labels

    textSupporting text primitives

    Type

    No type

    Projects

    Status

    Update

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions