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

Bug fix: TTF extension was wrong. update font types, add OTF type. #8898

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

galenhuntington
Copy link

No description provided.

Copy link

@galenhuntington It appears that this is your first contribution to the project, welcome.

With apologies for the bureaucracy, please could you prepare a separate PR to the 'tiddlywiki-com' branch with your signature for the Contributor License Agreement (see contributing.md).

Copy link

netlify bot commented Jan 19, 2025

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit f77d33a
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/678fd607de845500084e5d45
😎 Deploy Preview https://deploy-preview-8898--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pmario
Copy link
Member

pmario commented Jan 20, 2025

I think we need to have a closer look.
May be the mime types have to be extended. See: https://www.iana.org/assignments/media-types/media-types.xhtml#font

Also see: https://www.rfc-editor.org/rfc/rfc8081.html

@pmario
Copy link
Member

pmario commented Jan 20, 2025

application/font-woff is deprecated

image

application/x-font-xxx does not exist -- They are TW application specific.

Copy link

galenhuntington has signed the Contributor License Agreement (see contributing.md)

@Jermolene
Copy link
Member

Hi @galenhuntington – it is not clear why this mapping of .woff -> application/x-font-ttf was originally included, 4 years after the original support for WOFF fonts. I'm pretty sure it was intended as a hack because of the use of the non-standard MIME type. However, I note that $tw.utils.getFileExtensionInfo(".woff") currently returns {type: 'application/x-font-ttf'}, which seems definitively incorrect.

At this point, I think it probably makes sense to correct the MIME type as well as the file extension:

$tw.utils.registerFileType("application/font-ttf","base64",".ttf");

Perhaps it would be worth a systematic review of the MIME types that we use. According to Wikipedia, the MIME type for WOFF fonts has recently changed from application/font-woff to font/woff.

@galenhuntington
Copy link
Author

I assumed that 57e1fc6 was simply a cut and paste error. The previous line was copied and edited but the extension was inadvertently not changed.

The application/ types for fonts are obsolete but I expect browsers will still recognize them. However, it is better they be updated, so I did that in my newest commit. I also added a MIME type for OTF.

@galenhuntington galenhuntington changed the title Bug fix: TTF extension was wrong. Bug fix: TTF extension was wrong. update font types, add OTF type. Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants