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

Extending Carota #26

Open
mpage38 opened this issue Nov 25, 2014 · 0 comments
Open

Extending Carota #26

mpage38 opened this issue Nov 25, 2014 · 0 comments

Comments

@mpage38
Copy link

mpage38 commented Nov 25, 2014

Hello Daniel,
really an awesome work.
I am especially interested in the rendering part of Carota. The reason is that there is currently no satisfactory solution to draw HTML text on a canvas.

  1. There is html2canvas (http://html2canvas.hertzen.com/) but it fails on simple <ol> and <ul> lists.
  2. In the future, SVG foreignObject will do the job, but it is not implemented in IE, including IE11.
  3. There is also a solution based on Blob and createObjectURL but on IE<10 it fails as well.

From what I see, Carota is the best candidate to do the job.

In the short term, I would like to extend it to make it able to render other HTML tags, and other styling properties.
For the HTML part, I would like to implement <ol> and <ul> rendering. For CSS, I would like to implement margin properties, as well as line-height

To achieve this, I have a few questions.

  1. I guess I first need to implement some kind of box model into Carota. Am I right ?
  2. If yes, I imagine that I need to replace the line data structure with something that is more structured (box) ?
  3. I don't fully understand why line is made of words. I would have thought that a line is made of runs, i.e. text chunks with homogenous styling. Is it because of the justification algorithm ?
    Best,
    Michel
dhrleandro pushed a commit to dhrleandro/carota that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant