PixarAnimationStudios / OpenUSD-proposals

Share and collaborate on proposals for the advancement of USD
92 stars 25 forks source link

Autodesk: Add text proposal #24

Closed erikaharrison-adsk closed 3 months ago

erikaharrison-adsk commented 5 months ago

Description of Proposal

This is a proposal on supporting the text primitive within OpenUSD.

Supporting Materials

N/A

Contributing

erikaharrison-adsk commented 4 months ago

Update: Moved textMetricsUnit from TextStyle, ParagraphStyle, ColumnStyle to SimpleText and MarkupText. Whether the unit of a metrics is world unit, pixel or publishing point should be a property of a text primitive. All the styles bound to the primitive should have the same metrics unit.

dgovil commented 3 months ago

Thanks for putting up this PR, Erika! I'm going to confer with some folks internally to get some feedback going. Some early feedback was:

  1. Would it be possible to include some usda samples of what the data would look like?
  2. Is possible to include a comparison to our Preliminary Text schema just for completeness. It looks like yours is much more feature full, but it would be helpful for some third party folks who'd been using our schema to envision how they'd have to upgrade their data, specifically if there are any parameters that aren't accounted for.
  3. Is MarkupText the same formatting as used by Markdown? Is there a reason not to have HTML as one of the rendering methods, as it is more common for some UI level text in various frameworks such as Qt (and of course the web). That said, SwiftUI does support Markdown formatting so markdown syntax would naturally fit there as well
  4. Similarly, for styling, has it been considered to use a CSS string? One worry is that we'd have to reimplement a lot of pre-thought out styling here whereas CSS (as complex as it is) has a lot of that legwork done. This would be also similar to how Qt defers more advanced styling to stylesheets while still supporting some parameters to be set directly.
PierreWang commented 3 months ago

Thanks for putting up this PR, Erika! I'm going to confer with some folks internally to get some feedback going. Some early feedback was:

  1. Would it be possible to include some usda samples of what the data would look like?
  2. Is possible to include a comparison to our Preliminary Text schema just for completeness. It looks like yours is much more feature full, but it would be helpful for some third party folks who'd been using our schema to envision how they'd have to upgrade their data, specifically if there are any parameters that aren't accounted for.
  3. Is MarkupText the same formatting as used by Markdown? Is there a reason not to have HTML as one of the rendering methods, as it is more common for some UI level text in various frameworks such as Qt (and of course the web). That said, SwiftUI does support Markdown formatting so markdown syntax would naturally fit there as well
  4. Similarly, for styling, has it been considered to use a CSS string? One worry is that we'd have to reimplement a lot of pre-thought out styling here whereas CSS (as complex as it is) has a lot of that legwork done. This would be also similar to how Qt defers more advanced styling to stylesheets while still supporting some parameters to be set directly.

Thank you for your comments.

  1. The sample usda files are included with this comment.

SampleUSDA.zip

  1. Here is a rough compare with the Preliminary Text schema. And I can add the compare to the proposal.

Compare

  1. We use MTEXT as the default support because it is widely used in our Autodesk product.

  2. We didn't consider to use CSS string for styling. Indeed our implementation was a porting from a traditional text system we already used for years.

erikaharrison-adsk commented 3 months ago

Update pushed. Please let us know if this addresses things.