[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTML-Info design
From: |
Eli Zaretskii |
Subject: |
Re: HTML-Info design |
Date: |
Mon, 29 Dec 2014 19:44:35 +0200 |
> From: Lars Ingebrigtsen <address@hidden>
> Cc: address@hidden
> Date: Mon, 29 Dec 2014 17:32:52 +0100
>
> Eli Zaretskii <address@hidden> writes:
>
> > Fortunately, such a capability already exists, I think: see the
> > function 'font-get-glyphs'. Does it solve your problem? If not, what
> > API would you like to have?
>
> I've just looked at the doc string of that function briefly, and I'm not
> sure how I would use that to do filling. I need to know the width a
> text will take in the buffer, so that I know when to break the line and
> start a new one. Is it now possible to write a function like
> `pixel-region-width' that would say how much space the text will occupy?
Either make a string of the text you want to display, or insert that
text in a temporary buffer, then use this function to find the width
of that text by summing the widths of all the glyphs. Find the
largest substring whose glyphs' summary width fits into the portion of
the window width you allotted to the left pane, and insert that
substring. Loop around.
Should work, no?
> Given that the font used for that text is variable-width (and the region
> possibly uses many fonts).
The function returns a vector of glyphs, where each glyph is described
using its attributes, including its pixel width.
You have font-at function to tell you which font is used to display
what buffer/string position.
OK?
- Re: HTML-Info design, (continued)
- Re: HTML-Info design, Eli Zaretskii, 2014/12/29
- shr: tables, Ivan Shmakov, 2014/12/29
- Re: HTML-Info design, Yuri Khan, 2014/12/29
- Re: HTML-Info design, Eli Zaretskii, 2014/12/29
- Re: HTML-Info design, Lars Ingebrigtsen, 2014/12/29
- Re: HTML-Info design, Yuri Khan, 2014/12/29
- Re: HTML-Info design,
Eli Zaretskii <=
- Re: HTML-Info design, Richard Stallman, 2014/12/29
- Re: HTML-Info design, Juri Linkov, 2014/12/29
- Re: HTML-Info design, Richard Stallman, 2014/12/28
- Re: HTML-Info design, Nic Ferrier, 2014/12/28
- Re: HTML-Info design, Eli Zaretskii, 2014/12/28
- Re: HTML-Info design, Stefan Monnier, 2014/12/29
- Re: HTML-Info design, Richard Stallman, 2014/12/29
- Re: HTML-Info design, Juri Linkov, 2014/12/28
- Re: HTML-Info design, Stefan Monnier, 2014/12/29
- Re: HTML-Info design, Lars Magne Ingebrigtsen, 2014/12/29