To work around the restriction of the same-origin font policy, you can opt for using relative links like (../fonts/font-name.ttf)
or absolute links like (/fonts/font-name.ttf)
for your font files instead of including the entire domain name in the @font-face
src path (
http://www.example.com/fonts/font-name.ttf
).
Even with flexible file paths in your stylesheets, if the CSS is served from a different domain (or sub-domain) than the one it is requested from, you will still face the same origin policy.
WordPress theme URLs are constructed using the full domain name in the path, which can be a major part of the issue.
For instance, if you are on the page:
http://example.com/about
and the fonts are delivered through CSS from:
http://www.example.com/css/screen.css
You will encounter the same origin policy because the fonts listed in the CSS are sourced from a different domain. Remember, technically sub-domains like "www" are considered separate domains.
A solution to this problem is to set up Apache to redirect all incoming URLs to the domain that matches your WordPress Site Address.
example.com -> www.example.com
(or vice versa)
By doing this, all images, stylesheets, and fonts will be served from the same domain, avoiding your issue(s).