【问题标题】:Error loading font with watermark codeigniter使用水印 codeigniter 加载字体时出错
【发布时间】:2020-03-10 09:30:50
【问题描述】:

谁能帮帮我。我正在尝试创建水印,但在加载字体时遇到问题。 当我使用 wm_font_path 函数时,水印不会出现在图像上。 当我不使用 wm_font_path 函数时,水印会以系统默认字体出现。

另外,wm_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);

有人遇到过这个问题吗?

PHP 7.3 版

【问题讨论】:

    标签: php codeigniter fonts watermark


    【解决方案1】:

    您正在使用'./media/fonts/unineuebold.ttf';

    所以目录级别应该是这样的

    application
    media
     - fonts
        - unineuebold.ttf 
    system
    tests
    

    【讨论】:

    • 您好,目录级别正确。仍然没有加载源
    • 然后确保字体有效。如果您在 LIVE 中进行测试,请检查其放置或移动是否正确
    猜你喜欢
    • 2013-11-12
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 1970-01-01
    • 1970-01-01
    • 2015-05-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多