-
Notifications
You must be signed in to change notification settings - Fork 5
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
Uncaught RangeError: Cannot calculate the height of whitespace. #2
Comments
Update: Still having problems I'm using a TypeKit typeface — Acumin Pro Also having the same issue with:
I've also tried the following (which feels wrong), to no avail:
and
I'm using the Advanced Embed Code in the |
Hello, I will look into this issue today. Thanks for reporting! |
Thanks, Sebastién! Much appreciated. |
I'm not able to reproduce the error you have, but I see that you have this script Also, you don't need the advanced embed code from typekit in your WebFontConfig = {
typekit: { id: 'xxxxxx' },
loading: // this is fine,
fontactive: // this is fine,
} Also, in the p {
font-family: 'acumin-pro';
font-size: 100px;
font-weight: 400;
} I tried with a kit that has Futura PT and it worked fine! Let me know if that works for you. |
Hi @sebdesign, Thanks for getting back to me. To be clear, the exact code I'm using is below (without the Typekit embed code in the head) and a So, I guess I have 2 questions:
Cheers! |
Hi @humanjpg, Normally you should see an object with the font properties in the console, not in the inspector. This is the minimal code your page should have: <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<script src="https://unpkg.com/lodash@4.17.4"></script>
<script src="https://unpkg.com/cap-height@2.0.0"></script>
<script>
WebFontConfig = {
typekit: { id: 'xyxyxy' },
fontactive: capHeight.fontActive(function (properties) {
console.log(properties);
})
};
(function(d) {
var wf = d.createElement('script'), s = d.scripts[0];
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
s.parentNode.insertBefore(wf, s);
})(document);
</script>
</body>
</html> The The embedded With this exact code you should not see anything on the page, but you should see the font properties of all the fonts (and styles/weights) included in your kit in the console. Let me know if that works for you or if you see any error. Cheers! |
Ah, makes sense. That worked — thanks so much! I reckon it would be well worth adding that to the main readme. Super quick and easy :) |
@sebdesign though this raise an issue on the lib itself :) Using the args ( Does not work capHeight.calculate({
"font-style": "normal",
"font-weight": 400,
"font-size": "100px",
"font-family": "serif"
}, "HI"); Work capHeight.calculate('Hi', {
"font-style": "normal",
"font-weight": 400,
"font-size": "100px",
"font-family": "serif"
}; |
Hello,
I'm getting the following error in the console:
I've included
cap-height.js
manually right at the bottom of my project:And using TypeKit in the
<head>
. Any ideas?Many thanks!
The text was updated successfully, but these errors were encountered: