Passing a font from WebProcess to UIProcess

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Passing a font from WebProcess to UIProcess

Joshua Watt
All,

I have a need to "pass" a font from the WebProcess to the UIProcess
(really, I just need to be able to recreate the same font in the
UIProcess that was used in the WebProcess). Does anyone know of a
mechanism to do this (preferably in a platform independent manner)?
Ideally, there would be some structure or string that "describes" a
font that could then pass through and use it to (re)construct the Font
in the UIProcess.

Thanks,
Joshua Watt
_______________________________________________
webkit-dev mailing list
[hidden email]
https://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing a font from WebProcess to UIProcess

Myles C. Maxfield-2
You can use CTFontDescriptorCopyAttributes() and CTFontDescriptorCreateWithAttributes() and serialize the intermediate dictionary.

—Myles

On Jul 19, 2017, at 7:48 PM, Joshua Watt <[hidden email]> wrote:

All,

I have a need to "pass" a font from the WebProcess to the UIProcess
(really, I just need to be able to recreate the same font in the
UIProcess that was used in the WebProcess). Does anyone know of a
mechanism to do this (preferably in a platform independent manner)?
Ideally, there would be some structure or string that "describes" a
font that could then pass through and use it to (re)construct the Font
in the UIProcess.

Thanks,
Joshua Watt
_______________________________________________
webkit-dev mailing list
[hidden email]
https://lists.webkit.org/mailman/listinfo/webkit-dev


_______________________________________________
webkit-dev mailing list
[hidden email]
https://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing a font from WebProcess to UIProcess

Joshua Watt
On Fri, 2017-08-04 at 13:15 +0200, Myles C. Maxfield wrote:
> You can
> use CTFontDescriptorCopyAttributes() and CTFontDescriptorCreateWithAt
> tributes() and serialize the intermediate dictionary.

Ah, I should have clarified: This is on a Linux port :). I was hoping
for some platform independent method, but perhaps that isn't possible.

>
> —Myles
>
> > On Jul 19, 2017, at 7:48 PM, Joshua Watt <[hidden email]>
> > wrote:
> >
> > All,
> >
> > I have a need to "pass" a font from the WebProcess to the UIProcess
> > (really, I just need to be able to recreate the same font in the
> > UIProcess that was used in the WebProcess). Does anyone know of a
> > mechanism to do this (preferably in a platform independent manner)?
> > Ideally, there would be some structure or string that "describes" a
> > font that could then pass through and use it to (re)construct the
> > Font
> > in the UIProcess.
> >
> > Thanks,
> > Joshua Watt
> > _______________________________________________
> > webkit-dev mailing list
> > [hidden email]
> > https://lists.webkit.org/mailman/listinfo/webkit-dev
>
>

_______________________________________________
webkit-dev mailing list
[hidden email]
https://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing a font from WebProcess to UIProcess

Myles C. Maxfield-2
I don’t think there is a platform independent method.

—Myles

> On Aug 4, 2017, at 3:48 PM, Joshua Watt <[hidden email]> wrote:
>
> On Fri, 2017-08-04 at 13:15 +0200, Myles C. Maxfield wrote:
>> You can
>> use CTFontDescriptorCopyAttributes() and CTFontDescriptorCreateWithAt
>> tributes() and serialize the intermediate dictionary.
>
> Ah, I should have clarified: This is on a Linux port :). I was hoping
> for some platform independent method, but perhaps that isn't possible.
>
>>
>> —Myles
>>
>>> On Jul 19, 2017, at 7:48 PM, Joshua Watt <[hidden email]>
>>> wrote:
>>>
>>> All,
>>>
>>> I have a need to "pass" a font from the WebProcess to the UIProcess
>>> (really, I just need to be able to recreate the same font in the
>>> UIProcess that was used in the WebProcess). Does anyone know of a
>>> mechanism to do this (preferably in a platform independent manner)?
>>> Ideally, there would be some structure or string that "describes" a
>>> font that could then pass through and use it to (re)construct the
>>> Font
>>> in the UIProcess.
>>>
>>> Thanks,
>>> Joshua Watt
>>> _______________________________________________
>>> webkit-dev mailing list
>>> [hidden email]
>>> https://lists.webkit.org/mailman/listinfo/webkit-dev
>>
>>
>

_______________________________________________
webkit-dev mailing list
[hidden email]
https://lists.webkit.org/mailman/listinfo/webkit-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Passing a font from WebProcess to UIProcess

Michael Catanzaro
In reply to this post by Joshua Watt
Hi,

You can use FcNameParse and FcNameUnparse. Once you have an FcPattern,
that should be relatively straightforward.

Of course an FcPattern is different from a font, but that's probably
the closest you can get and it should be good enough.

Michael

_______________________________________________
webkit-dev mailing list
[hidden email]
https://lists.webkit.org/mailman/listinfo/webkit-dev
Loading...