Code Monkey home page Code Monkey logo

canvas-styled-text's People

Contributors

loganzartman avatar

Watchers

 avatar

canvas-styled-text's Issues

Better support for vertical alignment for multiline text

Currently, if you want to center- or bottom-align multiline text, you have to do it manually, because baseline determines the vertical alignment with respect to the first line of text only. I could add a separate verticalAlign, but it's unclear how that would interact with baseline. For example, a combination of baseline='hanging' and verticalAlign='middle' seems nonsensical (hanging with respect to what? what if there are exactly two lines?). I think it would be reasonable to have baseline align the entire block of multiline text, with the baseline corresponding to:

  1. the first line of text, for top and hanging,
  2. the last line of text, for bottom, alphabetic, and ideographic,
  3. the middle of the text, for middle

This would of course be a major version bump because it changes the semantics of baseline for multiline text, but I'm not sure it's worth trying to define how baseline and a hypothetical verticalAlign would interact.

Support automatic word wrapping

I think this would be awesome and very useful. However, I don't want a buggy, half-working version that only works on latin characters. I'm very interested in using Intl.Segmenter to generate the breakpoints, but it's not yet supported in Firefox (seems like it's tangled up in some efforts to avoid duplicating the functionality in the codebase). It might be worth doing this anyway, given that it's been accepted into the ES spec.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.