The Houdini Task Force just discussed Local Font Enumeration.
The full IRC log of that discussion
<TabAtkins> Topic: Local Font Enumeration
<TabAtkins> github: https://github.com/w3c/css-houdini-drafts/issues/951
<iank_> cmp: SImilar usecases, these web applications that we'd like to enable, would like to get a list of local fonts to present users a list of local fonts which are avail.
<iank_> cmp: Proposing a change to the font loading specification.
<iank_> <displays code on screen>
<TabAtkins> Reading again thru the old thread you linked, Myles, I find the major objection is about the usefulness of exposing binary data, given the necessity of porting a font-shaping engine to JS to do anything useful with it. There's a mention at the end that wasm should make this concern much less problematic, and I think time has shown this correct. ^_^
<iank_> cmp: Adds a FontFace.getMetadata() function.
<Rossen_> q?
<iank_> cmp: Again this is meant to be a font-chooser UX. E.g. allowing the user to access the local fonts, then allow access to the table.
<iank_> cmp: Also an Intent to Implment for this API.
<iank_> myles_: <discussion around minor code issue>
<iank_> heycam: navigator.fonts is a separate issue?
<iank_> cmp: navigaor.fonts is a FontFaceSet.
<iank_> heycam: Same as document.fonts?
<iank_> TabAtkins: No different.
<TabAtkins> s/No /No, /
<iank_> myles_: Can you state the usecase for this?
<TabAtkins> TabAtkins: document.fonts provides sync access to all the webfonts. This needs to give async access, for filesystem-enumeration reasons.
<iank_> cmp: Usecase for this is a web application would like to get a list of the locally installed fonts, the web application they shows a font picker, then the web application can access this font do things with it.
<iank_> myles_: Most document applications want to show the exactly the some thing? So what application are you thinking of?
<plinss> q+
<iank_> cmp: A design application for example. E.g. have a locally installed font that is under a license.
<iank_> TabAtkins: E.g. a company have purchase a particular font.
<iank_> TabAtkins: And want to use this consistently.
<iank_> myles_: We don't consider locally installed fonts for to web content.
<TabAtkins> TabAtkins: Or a company that can assume all the designers have access to a particular purchased font, and are just going to use it for local collab + printing.
<krit> q+
<iank_> myles_: Therefore would be able access via this api.
<iank_> s/would be/wouldn't be/
<Rossen_> q?
<heycam> q+
<iank_> myles_: In at least one of the 3 browsers, the issue would be solve that this API is trying to solve
<iank_> s/would be solve/wouldn't be sovled/
<Rossen_> ack plinss
<heycam> q-
<iank_> plinss: Rather than an api which enumerates all the fonts, expose an API which allows the browser to select a single font?
<iank_> TabAtkins: If that was the proposal would that reduce your concerns?
<Rossen_> q?
<iank_> myles_: Yes, but when fingerprinters run, they could enumerate over all the fonts which would provide a lot more entropy.
<plinss> s/browser to select/browser to display its own font picker and the user select/
<iank_> iank_: But its a behind a permission prompt?
<pwnall> q+
<iank_> myles_: I don't believe there is a set of words which would indicate informed consent.
<Rossen_> ack krit
<iank_> myles_: (for the permission prompt)
<TabAtkins> I agree, permission prompts are valuable, but limited.
<iank_> krit: What about a new UI element, if the font isn't available, would you get a notification that a particular font isn't available?
<iank_> krit: Would there be an API where an application could ask in a particular font is installed.
<iank_> heycam: In the font loading spec at the moment, if you call check() with a font which isn't available (e.g. not loaded, or not in installed local fonts) then it should throw.
<iank_> cmp: None of the implementations return the additional information.
<iank_> heycam: whether this API is a good idea is a separate question.
<iank_> krit: Have a document w/ text in it which used a separate font. The web application needs to identify this case.
<Rossen_> q?
<iank_> TabAtkins: On browsers which still expose a large set of local fonts via the font family. check() would still work. but on safari it wouldn't.
<iank_> myles_: We also know, iterating over all the fonts in a system is the wrong way to do it.
<Rossen_> ack pwnall
<iank_> pwnall: One usecase that I wanted to share, that wouldn't be solved w/ the picker in the UA. Web applications can design very complex pickers based on the usecase, e.g. the web application can filter based on what licsence types can be used (and should be available) for a particular project type.
<Rossen_> q?
<iank_> pwnall: There are usecases which are lost if the UA has to implement the picker.
<Rossen_> ack dbaron
<Zakim> dbaron, you wanted to raise one more issue about permission prompts
<iank_> dbaron: One other thought about permission prompt, has two purpsoes, to gain support, and to teach the user that this doesn't happen in other cases.
<iank_> dbaron: E.g. the location permission, this idicates to the user that the location isn't exposed by default. Teaches the user about the expectations around privacy for the user.
<iank_> dbaron: Asks a question to the user which doesn't usually happen.
<iank_> dbaron: In this case, given how fonts work today, that is quite difficult.
<Rossen_> q?
<iank_> TabAtkins: If the UA provide the font picker , then we wouldn't need that picker.
<iank_> TabAtkins: How would the web application know about the license type.
<plinss> s/that picker/that permission/
<iank_> pwnall: The web application would scan font tables, e.g. woff has a licensing table to provide the ability to filter.
<dbaron> I wonder how many seconds (or minutes) said app would take to do that scanning of font tables to populate the UI!
<TabAtkins> ScribeNick: TabAtkins
<TabAtkins> dbaron: We've def seen in browser font stack impls, especially for the "users who have lots of fonts" cases, just setting up the font infra in the browser can sometimes be a serious perf problem.
<TabAtkins> dbaron: So anya pp doing what you just said, scanning all the fonts, there's a good risk of that taking seconds to minutes.
<jsbell> q+
<dbaron> s/anya pp/any app/
<TabAtkins> cmp: Yeah, good point. We're trying to see the effect in practice as we experiment.
<TabAtkins> myles_: Do you know of a native app that does this kind of license filtering? I'd like to play with it.
<TabAtkins> pwnall: I'll follow up with you.
<myles_> mmaxfield@apple.com
<TabAtkins> astearns: There are "design applications" that will do pre-flighting of fonts used in a doc as it's doing output.
<TabAtkins> astearns: As you're saving something, you can ahve a step that checks for fonts and ensures they're licensed.
<TabAtkins> TabAtkins: That use-case would be handled by the font-face tables access of UA-picked fonts, without needing full enumeration.
<TabAtkins> jsbell: I use GIMP, it takes forever to load, that's what tools do.
<TabAtkins> jsbell: I think it's presumptuous to say that we don't think that class of applications can be used on the web.
<TabAtkins> cmp: Thank you for the comments! We'll follow up, please ping me with additional comments.
This issue is to capture the discussion minutes about the Font Enumeration API proposal: https://github.com/inexorabletash/font-enumeration/