js-quantities icon indicating copy to clipboard operation
js-quantities copied to clipboard

"pt" is an alias for both "point" and "pint"

Open rage-shadowman opened this issue 11 years ago • 2 comments
trafficstars

See https://github.com/olbrich/ruby-units/issues/35

rage-shadowman avatar Nov 07 '14 23:11 rage-shadowman

I disagree about the fix made in ruby-units (removal of pt as abbreviation of point). pt is commonly used with font sizes and CSS. I would like to keep the both and disambiguate them through a global setting representing an optional context like typography or cooking for instance. Depending on it, pt would be parsed as pint or point.

gentooboontoo avatar Nov 11 '14 13:11 gentooboontoo

There should definitely be some way to know what 'pt' is going to become before it is used. Right now it depends on the order of the internal UNITS declaration and looping which is not good.

If alias support was added, it would be easy to add a set of 'cooking' aliases or 'typography' aliases. These aliases can override any default aliases, like for 'time' purposes 'm' could become 'minutes' rather than 'meters'.

Ruby-units does allow for aliasing and therefore removing 'pt' as an abbreviation for 'point' shouldn't be an issue for them as you can change it programmatically.

rage-shadowman avatar Nov 11 '14 20:11 rage-shadowman