简体   繁体   中英

Error loading font with watermark codeigniter

Could anyone help me. I am trying to create a watermark but have a problem loading the font. When I use the wm_font_path function the watermark does not appear on the image. When I don't use the wm_font_path function the watermark appears with the system default font.

Another thing is that the wm_font_size function doesn't work properly because I can't increase the font size.

$image_data                 = $this->upload->data();
$config['image_library']    = 'gd2';
$config['source_image']     = $image_data['full_path'];
$config['wm_type']          = 'text';
$config['wm_vrt_alignment'] = 'top';
$config['wm_hor_alignment'] = 'center';
//$config['wm_vrt_offset']    = '300';
$config['wm_text']          = $nome;
$config['wm_font_path']     = './media/fonts/unineuebold.ttf';
$config['wm_font_size']     = 60;
$config['wm_font_color']    = '#4a4a4a';
$this->load->library('image_lib', $config);

Has anyone had this problem?

PHP Version 7.3

You're using './media/fonts/unineuebold.ttf';

So directory level should be like this

application
media
 - fonts
    - unineuebold.ttf 
system
tests

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