grapick
grapick copied to clipboard
Consider better-supported html entity for icon to remove stop
Grapick uses the HTML entity ⨯
as the icon for removing a stop. This entity maps to U+2A2F
which was introduced somewhat later to Unicode in v3.2.0 and therefore has lower inclusion among fonts than those which have been present from early on. For example, this is the supported font list from fileformat.info for U+2A2F
, which is an incomplete list but provides a point of comparison (see below).
A specific example of the issue is that Firefox and Chrome installed on some Linux versions use the FreeSerif font by default which does not include U+2A2F
.
Therefore, in order to use Grapick in a compliant manner requires either using custom code to replace that HTML entity with a more supported one, or adding a webfont to the site which supports the entity, neither of which is a very ideal scenario.
I'd like to suggest a couple options to help this issue:
The first and simplest is simply switching to a similar HTML entity with broader support. A likely candidate is ×
, which for comparison was introduced in Unicode 1.1.0 and has broad font support. The number of supported fonts given by fileformat.info is about 10 times larger.
Another option would be to provide an initialization option for Grapick to override the symbol used, something like
new Grapick({el: '#gp', removeStopSymbol: '×'})
However, this option may be somewhat cumbersome even though it's more adaptive, since it's likely that any such override would also necessitate overriding some Grapick CSS to accommodate inevitable slight size differences in whatever symbol is used. So, the first option may be better, but either would be a sufficient resolution. I can provide a PR if you'd prefer, if either option is agreeable.
Thanks for providing Grapick as an open source project!
Also, another option could be to include it as SVG, which for reference, is:
<path xmlns="http://www.w3.org/2000/svg" d="M28.125 344.8125 L14.0625 330.75 L77.625 267.1875 L14.0625 203.625 L28.125 189.5625 L91.6875 253.125 L155.25 189.5625 L169.3125 203.625 L105.75 267.1875 L169.3125 330.75 L155.25 344.8125 L91.6875 281.25 L28.125 344.8125 Z" />