On Thu, 02 Aug 2012 18:44:01 +0200, François Revol wrote:
> > I didn't know selection_traverse could get colours and text styles,
> > how does that work?
>
> See netsurf/beos/window.cpp:copy_handler:
>
> on each copy_handler() call it just checks for box->style,
> converts it using font_plot_style_from_css() into something I can
> extract the BFont object and color info.
> There I create a text_run object which just holds both info and char
> count, and add it to the list.
> It'd probably need some optimisation to merge identical runs but it works.
That's quite clever, probably incompatible with the new function
(which I guess is why Michael's flagged it), but exposing styles to
the gui_add_to_clipboard function might be a useful addition.
> The list or text_runs is then committed as a separate object along with
> the plain/text item in the clipboard, which applications like StyledEdit
> can use.
Shame the text styles in IFF FTXT are a load of rubbish/hardly
supported anywhere (the F stands for "formatted", but I've only ever
seen it used for plain text).
There was some discussion recently about new text style chunks. If
it's possible to get the style info out of NetSurf it might be worth
me defining and submitting my own chunk.
I know BeOS was inspired by AmigaOS, but does it use IFF for the
clipboard or something else?
(might be dragging this a bit off-topic now, reply privately if you
like)
Chris
No comments:
Post a Comment