Re: [whatwg] Unicode -> ASCII copy/paste fallback

On Fri, Feb 13, 2015 at 11:11 PM, Glenn Maynard <glenn@zewt.org> wrote:
> On Fri, Feb 13, 2015 at 9:02 AM, Glenn Maynard <glenn@zewt.org> wrote:
>>
>> Copying ASCII isn't desirable.  It should copy the Unicode string "a → b".
>> After all, that's what gets copied if you had done "<span>a → b</span>" in
>> the first place.
>
>
> (Oh, I missed the obvious--the "->" from Firefox is coming from the HTML, of
> course.)
>
> I guess what you're after is being able to have separate text for display
> vs. copy.  I'm sure you don't actually want to use a hacky custom font.
> What's the actual use case?  In general I think browsers should always copy
> just what the user selected, and not let pages cause something other than
> that to be copied, since things like that are generally abused (eg.
> inserting linkback ads to copied text).

I am writing a documentation generation tool for a programming
language with right arrows represented as -> but would like to render
them as →. Programmers are used to writing in ASCII and reading
typeset mathematics. If I present documentation to them via a
purpose-built document browser, I should give them the option (at the
generation/styling stage) of making those documents as pleasing as
possible.

A ligature font is the closest thing I've seen so far to being
"semantically accurate" and degrades gracefully.

It's not quite totally accurate as I already have a font and it
already has all the glyphs I'd like to use. In this way, the font is a
"level too low" at character rendering rather than glyph selection.
Fortunately, the surrounding font doesn't really matter so the
ligature font can be made to fit quite well. Unfortunately, I can
imagine much simpler expressions of the behavior I'm after that don't
involve talking about vectorized graphics and transmitting kilobytes
of typeface description.

I think the current behavior of CSS content not being copied makes
some sense. It is *stylistic* content after all... I'm a bit
disappointed that vendors can't seem to agree on what content is
"hidden" as Boris has said.

> --
> Glenn Maynard
>

Received on Saturday, 14 February 2015 18:34:39 UTC