gdi+ - How do applications like Firefox calculate text height efficiently? -



gdi+ - How do applications like Firefox calculate text height efficiently? -

i'm curious technique fast applications (maybe safari improve illustration here) calculate height of terribly long page of text (for example, chat log or huge document).

considering there huge amount of text same line height, can multiplied number of lines. however, how know how many lines <p> span in specific width?

what can come they:

calculate width of every character , store quick addition, use calculate width of words, add words , spaces' widths while comparing block-level width, adding lines needed.

this seems indeed fast, since additions , comparisons way, way faster measuring string in gdi+. have no thought if done, since reliability comes first, , afaik text rendering introduces kerning, , have no thought how easy or hard info gdi+.

also, a screenshot reactos made me believe firefox calculates each letter's size , position.

text gdi+ measurement kerning

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

Using ajax with sonata admin list view pagination -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -