Skip to content

Parsing CSS string adds unwanted = entity at the bottom of a base64 font #1718

Answered by vitto
vitto asked this question in Q&A
Discussion options

You must be logged in to vote

It was my fault, when a font is converted to base64, if it's length is not a multiple of 3 bytes, the number of bits making up the result will not be a multiple of 6. Null bits (0) will then be inserted at the end (4 or 2), and added to the encoded value 0 to 2 '=' symbols (padding character) sufficient to reach a multiple of 4 symbols.

I needed to remove these padding characters to avoid the font to be not loaded.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@vitto
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by vitto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants