I’ve been hoping to make a special font (“linja pona”, used for writing in the constructed language “toki pona”) available in a tiddlywiki.
I tried to copy the technique here, which explains how the “Arvo” font works in the Starlight theme –
but I’m not getting it working. I’ve dragged and dropped an otf file (linja-pona-4.2.otf) into the wiki, changed its mime-type to “font/otf”, and made a stylesheet tiddler looking like
it does change font! But it changes it to “Nimbus Roman” (which I learned from looking in the browser inspector)… as if it can’t actually find linja pona.
Did I miss a step? Is there some other magic I need to do to import the file correctly?
If I recall correctly using this method demands you are online but you can copy what you find at the end of your link and bring it into tiddlywiki perhaps with a stylesheet tag.
toki a! mi jan pi toki pona li pilin pona mute tan lon sina mi la toki pona en ilo Tiddlywiki li kulupu pona!
sina wile kepeken linja pona la ni li suli kin: ilo Browser o ken e nasin pi wan sitelen. mi sona ala e ken pi ilo ale. sina wile pali ante tawa ken ni anu seme?
english:
hi, i think toki pona and TW5 go well together!
this font makes heavy use of the ligature feature of fonts to combine letters into single glyph “word” characters. is this possible in all/any browsers? would extra action be needed to enable this?
Is that format("woff") the issue? Should it be – and I’m just guessing! – format("otf")?
I don’t know much about fonts, and my last attempt ended in failure, working only in my Linux dev environment, but not on Windows. So don’t take my word for anything here!
Since that technique was for a webfont, and you’re wanting to incorporate the font file, I don’t think it’s a good model.
(Also, I notice that your font isn’t being named consistently in the code you quoted — in addition to the format discrepancy noted by @Scott_Sauyet.)
I do not know how to make tiddlywiki recognize a font that has been uploaded as a tiddler within the wiki itself. (Perhaps .otf would need to be one of the recognized tiddler types, like image/png etc., I suspect? Edit: As you already seem to have noticed, you can specify font/otf as a tiddler type!)
EDIT: SEE NEXT POST, which includes demo of fully-embedded font (saved into and accessed from within tiddlywiki).
[resuming my original response:] … However, you can include a link to a font that’s hosted anywhere you like, probably including your local filesystem if you’re working offline.
At my google-fonts demo site, I’ve got a tiddler showing how I use a font that lives in my personal dropbox directory. (It’s a compact display font purchased years ago, so I hope there are no copyright complaints.)
You should be able to use a local url that points to something on your own filesystem, if your tiddlywiki is all offline. (I’m working mostly with tiddlyhost, so I never work with local directories.)
Ah, thanks! I realize the problem is that the font is active on my own desktop. I thought TiddlyWiki was working with the embedded font file, but I neglected to consider this possibility and test how it works with a font that’s not on my OS. D’oh.
There may be more to it than that. When I tried this five years ago, I had Linux users report success, and Windows users report failure. But there were only a few of each, so it could be coincidence.
Yeah, I just tried my old wiki with the supposedly-embedded font in it on my work Windows box, and it failed. Then I installed the font on Windows and it worked fine. I really would like to get this working. Hmm.
That’s an impressive amount of font work in the wiki that @Springer posted, but really, my method (up thread) is simple and has been working for me “forever”.
Yeah, I know, you want to truly embed… well, that’s okay – if you can get it to work.
Indeed, I have only ever worked with hosted fonts such as google fonts (and fonts available on my local machine). I imagine for something that is absolutely intrinsic to the purpose of the wiki (which may be the case for OP), it would be ideal to find a way to have the font right there within the single-file TiddlyWiki, thus being confident that the wiki can’t be cut off from its associated font file (even if emailed to someone, opened on another machine without internet, etc.)…
I’m giving up on this rabbit-hole for now (EDIT: That was a lie.). I continue to hope that it is possible to embed a font within a tiddler (and actually get css to access it for display within the same wiki), simply because others claim to have done so… but it’s not easy!
Same here. I tried and gave up once, and only today realized why it seemed to work for me and not others. I may look again soon, but it has been frustrating.
Wow, thanks everyone for the ideas and advice! I found a way to do it through experimentation, based on the existing embedding of the “Arvo” font in the default tiddlywiki. Here are the things I needed to do:
USE A WOFF, NOT AN OTF OR A TTF
At least one woff I tried mysteriously didn’t work, but others did, since I’d converted that one with an online service I assume it converted wrong or badly or something
In order for the <<data-uri >> macro to work, your stylesheet tiddler must not have the css content type! A blank content type works.
Sounds like there are some other resources I could have used but I wasn’t checking my mail while I was figuring this out so I didn’t find out about them till I’d already figured out how to do it this way