PennController for IBEX › Forums › Support › Text Not Displaying Correctly
Tagged: font, font_face, font_family, google_fonts
- This topic has 4 replies, 3 voices, and was last updated 1 year, 10 months ago by nasimbhmn.
-
AuthorPosts
-
November 9, 2021 at 5:47 pm #7486topasnaaParticipant
Hi Jeremy,
I am helping a group on their project and they seem to be having an issue displaying text correctly. They want the words in their study to display an ambiguous letter between a b and a p. For some reason, the text is delaying random numbers instead. They think this might be an issue with their file type for the front (.oft) but they are not sure.
Here is the link to the experiment
https://farm.pcibex.net/r/VuRsKS/Thank you,
AnaNovember 9, 2021 at 7:36 pm #7487JeremyKeymasterHi Ana,
The numbers are not random, they match exactly the text from the table’s
token
column, eg:3eak,beak-peak_1_VOT_1.wav,438 5eak,beak_peak_2_VOT_2.wav,438
Using a custom font is more involved than just uploading a font file to a project’s Resources folder. It requires using the
@font-face
CSS rule to fetch the font file. The PCIbex Farm won’t allow background access to the font file, it will result in a CORS error (you can, however, download it manually by directly entering the URL in the address bar, but that’s of no help here)My suggestion is to upload the font file on a domain that won’t throw a CORS error and insert this in the project’s global_main.css file under the Aesthetics folder:
@font-face { font-family: "Arial Modified"; src: url("https://url.toward.the/font.otf") format("opentype"); } .PennController-wordtoken { font-family: "Arial Modified"; }
I should note, however, that the Arial font is not under an open license, which means you cannot modify it legally
Jeremy
November 19, 2022 at 10:39 am #9719nasimbhmnParticipantHi Jeremy,
I have a problem with changing the font via CSS. I was able to use google API fonts in the original Ibexfarm, but now in PCIbex, neither
@import
nor@font-face
really works.
Here is the demo of a sample script. Could you please help me resolve the issue?
https://farm.pcibex.net/r/pfEfgV/FYI, in this demo, I have added the font to the global_z.css, but I even tried revising the original global_main.css and nothing changed.
Thanks and best, Nasim
November 22, 2022 at 6:55 pm #9725JeremyKeymasterHi Nasim,
Not sure why the
@import
rule doesn’t work, but I don’t think usingurl("https://fonts.googleapis.com/css2?family=Raleway:wght@500&display=swap")
as thesrc
attribute in@font-face
is valid anywayHowever, if I visit that URL and copy-paste the raw CSS rules back in global_z.css in place of the
@font-face
rule you currently have, I do see the Google font when I open the experimentJeremy
November 27, 2022 at 1:54 pm #9738nasimbhmnParticipantahh, you’re right, it works perfectly when I use the font-face rules directly in the CSS file.
Many thanks. -
AuthorPosts
- You must be logged in to reply to this topic.