-
Notifications
You must be signed in to change notification settings - Fork 142
[css-typed-om] Font Family Name doesn't uniquely identify a font face #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@shans Could you please add the right labels and stuff? I don't have access... |
In fact, there's no single way way to uniquely id a font face without specifying all of its attributes. This particular interface probably needs to be no-constructor, and instead provide a factory function that searches for a given font face when providing with search terms. |
Okay, so there are two totally different ways of talking about "font faces" that we need to address here. First is the equivalent of @font-face, representing an actual, concrete font face. This is a ResourceValue or equivalent, can be passed around to Worklets so they can use fonts, etc. I think this is just the already-existing FontFace interface, and we can just use that directly. Second is representing the value of the 'font' property, which is a search query against the document's font faces. It's not a font face itself, it doesn't load anything, etc. This just needs to be an object with The latter can be pushed off for now, with us just relying on CSSStyleValue to handle it, if we dont' want to handle it at the moment. For the former, is there anything wrong with just returning FontFace objects? More importantly, tho, when is this ever expected to be returned from a TypedOM API? No property will ever return this as a value; so it seems we can just ignore it too? |
@shans WDYT? |
If we don't have the former, how will custom paint end up supporting text rendering? |
Thru a separate mechanism? Chatting with @bfgeek after posting this yesterday led us to the vague idea of just providing the equivalent of |
The former is @font-face, not FontFace. Naively, the idea of being able to specify an exact, loaded font as the text rendering font seems to be the most basic primitive we could support. Hooking into font querying and fallback could be something we can do after implementing this basic feature. |
Sure, but that's not what 'font' does, or any other property in CSS. This is my point - there's no circumstance in TypedOM spec that can return something that corresponds to an exact font face; there's no |
The Working Group just discussed
The full IRC log of that discussion<nainar> Topic: ont Family Name doesn't uniquely identify a font face<nainar> Github: (https://github.com//issues/405 <nainar> Github: https://github.com//issues/405 <dbaron> also Matt Woodrow, Mozilla (remotely) and Daniel Holbert (Mozilla) <nainar> TabAtkins: trying to burn thrugh Typed OM issues <nainar> TabAtkins: Current design of fontface - not designed well. Trying to 1) serve as a value to pipe to PaitWorklet, 2) be the value for fontface - to query <nainar> TabAtkins: works for 1) not for 2) -> as fdiff type of objecct <nainar> TabAtkins: fontface value is a query for a font object - find a matching fontface in a doc <nainar> TabAtkins: change spec to allow fontface value object - so that it isnt directly returned, and then execute that query against a doc from worklet to get a fontface - to use in Worklet <nainar> TabAtkins: last proposal - seems vague but... equivalent of fontfaceset.load <tantek> trackbot, start meeting <nainar> TabAtkins: so that you can pass in font face query. .... So that when set of fontface set changes we can get correct fontface <nainar> astearns: given confusion - rename this fontfacevalue object? <nainar> TabAtkins: we already have a fontface object in CSSOm spec <nainar> dbaron: Font people call the fontface -> face? <nainar> TabAtkins: we need to get invalidation logic right to make sure we paint with the correct fontface resouce <nainar> iank_: if the resource loads and matches the fontface query - we should invalidate the paintworklet, we can then assign it to the canvas. <nainar> astearns: can worklet tell when validation happens? <nainar> TabAtkins: if we can get invalidation logic right - it only invalidates when a better font shows up <nainar> surma: where is the query logic being used? <mwoodrow> Rossen: Sure can, thanks! <nainar> TabAtkins: used implicitly in css font matching algo. also use it explicity in fontfaceset <nainar> TabAtkins: can call .load function on font property and it returns the font that matches it <nainar> surma: you get the font closest matching? <nainar> TabAtkins: yes <nainar> TabAtkins: Dont have a design for it yet, updating WG - that I will rip out and replace it with a new design. So contribute here on issue <nainar> Rossen: how does it interesect with fontface load() and other various events? <tantek> trackbot, start meeting <trackbot> Sorry, but no Tracker is associated with this channel. <dholbert> Are "font-family"or "<family-name>" the same thing as this "font-face query that the font property would use" thing? ( https://drafts.csswg.org/css-fonts-4/#font-family-desc ) <nainar> TabAtkins: the ideal design - declare a custom property with this font - if you pipe it as input to Worklet then (auto/manually) we get the font face objecct as a resut of running this query agianst document <xidorn> q+ <tantek> trackbot, associate this channel with #css <nainar> TabAtkins:you should kick of a load and then be alerted when loaded. Get a Promise and then you get alerted when it is loaded. <xidorn> q+ <tantek> trackbot, start meeting <trackbot> Sorry, but no Tracker is associated with this channel. <astearns> ack xidorn <nainar> xidorn: Paintworklet cant use font right now? <nainar> iank_: yes! <nainar> xidorn: Something in typed OM can make it usable? <nainar> TabAtkins: canvas API that selects font - implicityly executes the font matching alog. We also need a change to canvas API in general - that takes a font face objecct directly <nainar> iank_: current paintrenderingcontext2D. doesnt take a fontface directly . We dont want to take font query string - as we dont know how to invalidate. <nainar> TabAtkins: involved change acoss multiple APIs <nainar> Rossen: bring back with more spec text? <nainar> TabAtkins: Yes this is a FYI. <nainar> TabAtkins: more involved proposal later. <nainar> fremy: are you sure fontface object is needed? Maybe you need a query that you can depend on. Use normal canvas? <nainar> TabAtkins: Yes but you dont need to use the same query to invalidate against. <nainar> TabAtkins: also there is some cross worker communication. We want to limit that to once at invalidation time. <nainar> iank_: The only way you get this is through TypedOM <nainar> surma: People are askign meif i can use fontface with canavas same q for custom paint <nainar> astearns: crcisla to get result of query in worklet - you use fallback if you dont get what you expect <nainar> Rossen: do you need a resolution? <nainar> TabAtkins: Yes please. <astearns> s/crcisla/critical/ <nainar> RESOLVED: Kill FontFace spec text |
Uh oh!
There was an error while loading. Please reload this page.
https://drafts.css-houdini.org/css-typed-om/#fontfacevalue-objects
(Brought up by ksakamoto@ on my CL)
I'm not quire sure how |state| attribute should behave, as font family name does not uniquely identify font face.
For example, this defines two @font-face rules for 'Roboto', one for regular weight and one for bold. When only bold face is loaded, what |state| should return?
The text was updated successfully, but these errors were encountered: