Skip to content
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

Text in canvas affected by CSS(font "no-real-font-123", character"\ud83d\ude03") #66

Closed
gazhikaba opened this issue Aug 5, 2015 · 6 comments
Assignees

Comments

@gazhikaba
Copy link

@gazhikaba gazhikaba commented Aug 5, 2015

When set the font as "no-real-font-123", the canvas will paint the text as default font, is that right?
But I found the default font could be changed by CSS, and also "\ud83d\ude03" will become □□ sometimes.

Then I got different fingerprint on two page with same browser, because CSS of two page are different they got different font in canvas.

I'm not good at CSS, so I'm not find out the reason.

Is there have a remind list like "Don't do it in your CSS"?

And here is one thing that I found can't do.
If set style of span like:

span  {
 //some thing
}

That will make jsFontsKey get nothing, because it use span to detect fonts.
Following way is OK.

<style>
.style-of-span {
  //something
}
</style>
<span class='style-of-span'> Bili</span>
@Valve

This comment has been minimized.

Copy link
Owner

@Valve Valve commented Aug 5, 2015

@gazhikaba thanks, very good observations. Will look into it.

@Valve Valve self-assigned this Aug 23, 2015
@Valve

This comment has been minimized.

Copy link
Owner

@Valve Valve commented Aug 23, 2015

@gazhikaba regarding the default font change. Do you mean that the same web page changes its default font once in a while? Why does it do that, it does not make sense to me at all, never seen this in real life. Regarding span element css styling I cannot reproduce it. Could you please create a test case in jsfiddle or similar?

@gazhikaba

This comment has been minimized.

Copy link
Author

@gazhikaba gazhikaba commented Aug 27, 2015

@Valve We want to collect fingerprint from several site, and they are multifarious …… we don't want to change them, only add the JS library. So we need the fingerprint is same in every page.

@Valve

This comment has been minimized.

Copy link
Owner

@Valve Valve commented Aug 27, 2015

@gazhikaba , got it. The only solution I can think of now is to add a special configuration option, like 'options.dontUseFakeFontInCanvas = true'. If this option is set to true, fake font will not be used, instead, I'll use the 'Arial', which is ubiquitous, so you'll get consistent results. Please let me know it it works for you and I'll implement it.

@gazhikaba

This comment has been minimized.

Copy link
Author

@gazhikaba gazhikaba commented Aug 28, 2015

@Valve It works, and I'm not add option, just change the font to "Arail".
Thank you.

@Valve

This comment has been minimized.

Copy link
Owner

@Valve Valve commented Aug 28, 2015

@gazhikaba , I cannot change the font to Arial, because it will reduce the entropy for users that use it on one site. I'll add this option for you.

@Valve Valve closed this in 761e1b6 Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.