Re: [css-font-loading] 'family' should be 'fontFamily', to prevent API fragmentation

The base JavaScript API for working with CSS in general, where hyphenated
CSS property names are mirrored as camelCase property names. In the case of
setting font family, front end devs know this requires
"element.style.fontFamily = 'Arial, Helvetica, ...';".

So, given that @font-face also uses the "font-family" CSS property, keeping
this property mirrorred as "fontFamily" on the JS side, to prevent
confusion for the people who actually have to write front end code on an
hourly basis, makes a whole lot of sense.

- Pomax

On Wed, Sep 2, 2015 at 3:04 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Mon, Aug 31, 2015 at 8:57 AM, Mike Kamermans <nihongo@gmail.com> wrote:
> > I'm trying out the new font loading API, but noticed that counter to
> > pre-exiting APIs, the font family property of the FontFace object is
> called
> > "family", not "fontFamily". This should probably be changed, as it bakes
> > confusion into the various APIs for working with fonts.
>
> What "pre-existing APIs" are you referring to?  The names were chosen
> to match up with the names in the CSSFontFaceRule interface
> <https://drafts.csswg.org/css-fonts/#om-fontface>.
>
> ~TJ
>

Received on Friday, 4 September 2015 15:41:45 UTC