简体   繁体   中英

Using Google Font in PHP GD

I am trying to use a custom font in an image made with PHP GD.

I intend to call int imageloadfont(string $file) , but I'm not sure what $file to give if I want to get a Google Font directly from their website.

Do I need to download the font or is there a way to get it remotely?

You can use the .ttf file from Google servers directly if you have allow_url_fopen enabled in your PHP installation. Look into the stylesheet to get the correct url.

However, for best performance, availability and security, you should download the file and use a local path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM