How would I get Arabic font?

DJEB's picture

I am trying to add an Arabic traslation to a course on wordpress. How would I go about getting an Arabic font for my H5P content?

 

Thanks

icc's picture

For content that are not in iframes (Multichoice etc.) you should be able to just add the font to your theme, and it should work. For getting the font inside iframes you must add a small JavaScript to your theme:
H5PIntegration.core.styles.push('/url/to/my/font.css');

This will add a custom stylesheet to all H5P iframes, and you can now add custom fonts and styling to your interactivities.
But make sure the script runs after the script that creates the H5PIntegration object, if not you will get an error message in your console (Ctrl+Shift+J in Chrome).

Let me know how it goes :-)

DJEB's picture

Thanks for that. I'm not sure how to do that, but I think with a bit of digging around this site and thinking, I can figure it out. If not, I'll get back to you.

icc's picture

np! 

Are you adding these font to the rest of the theme, if so are you doing it through the theme or using some sort of plugin?

DJEB's picture

I've got a multisite with one site being Arabic. (See http://teleclassafrica.org/ ) It has handled Arabic text OK. I just need it inside of H5P for slides and multiple-choice questions.

DJEB's picture

Oh, and I'm not using a plugin for the Arabic.

icc's picture

Did you write the text into the H5P editor using your keyboard, or have you copied the text?

The font that is used should be able to display arabic characters, which leads me to believe there might be something wrong with the input / or wysiwyg editor.

If I copy some arabic text, I'm able to insert it, but it's not RTL.

 

DJEB's picture

I tried to copy and paste the text, which just gives the output "???????????????????????"

In the editor it showed it pasted as right-to-left, but it wouldn't display after saving and going live.

icc's picture

I'm guessing the source you're copying from adds some invisible styling to the text, which is not supported by the wysiwyg editor in H5P. (CKEditor)

Could you try to copy the text to a simple text editor like notepad, and then copy the text from notepad and into H5P. That might work.

DJEB's picture

I'll give it a shot. Thanks.