Comments (5)
In case it helps anyone, the offending value in the code that causes a negative font size for small displays is line 211
var autoGuessSubtraction = 32, // font size in px
this gets substracted and if the font is generally smaller, results in a negative number.
So just setting this to lets say 10 fixes it:
var autoGuessSubtraction = 10, // font size in px
from bigtext.
I ran into issues with negative sizes as well.
The starting font-size must be small enough to guarantee that each individual line is not wrapping pre-BigText. If the line is too long, BigText will not size it correctly.
After reading this line from the readme, I set the default font-size in my css to a much lower value and no longer saw negative font sizes.
from bigtext.
Thanks @timrwood, this is likely the issue. I’d like to fix this internally to BigText so I’ll leave this issue open to log it. Thanks!
from bigtext.
wearetelescopic's post fixed this for me
from bigtext.
Is there any reason for not changing this value in code? Would it break something else?
The tip by @wearetelescopic actually helps, thanks a lot!, and is still needed:
https://jsfiddle.net/70d2caze/1/
Set autoGuessSubtraction = 10 and it will look neat and tidy.
from bigtext.
Related Issues (20)
- Does BigText work with <a href> links? HOT 1
- Not working with textarea HOT 1
- BigText taking ~5sec to apply after full site loads, Wordpress HOT 2
- BigText does not care about div height to set font-size
- Uncaught TypeError: Cannot read property 'BigText' of undefined
- "Re-BigText on Resize" is misleading
- passing in the window object
- BigText stops working when required font-size is less than 24px HOT 1
- The latest release is no longer compatible with jQuery 3 HOT 4
- Callback option
- Doesn't work out of the box with webpack.
- bigtext is not a function
- Word spacing goes wrong on iOS Safari
- word-spacing doesn't get adjusted properly in Safari HOT 1
- Not live update when resizing window
- Scroll up when resizing window
- Vertical spacing (line height) with BigText
- Font size is being set too large with embedded font face
- resize event is not properly calculating font size
- Initial text size wrong, but on resize it works HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigtext.