imagefttext ã® ãªãã·ã§ã³å¼æ° extrainfo ã«ã¤ãã¦
PHP 㧠TrueType ãã©ã³ãã®æç»ã«ã¤ãã¦ã¯ã2種é¡ã®é¢æ°ãããã¾ããããã imagettftext 㨠imagefttext ã§ãã
両è
å
±éããã®ãæåã®æç»ééã«ã¤ãã¦ã®è¨å®ãã¾ã£ãããªãã¨ãããã¨ã§ãç¹ã«æåã®å·¦å³ã®ééã®è¨å®ããªãã®ãé常ã«å°ãããã§ãããããã¥ã¢ã«ãè¦ã㨠imagefttext ã«ã¯ extrainfo ã¨ãããªãã·ã§ã³ã渡ãã°ãªããèµ·ãããããã
ããããããã¥ã¢ã«ã«ã¯
ãããã®é¢æ°ã¯ãç¾å¨ã®ã¨ãã詳細ãªæ
å ±ã¯ããã¾ãããå¼æ°ã®ãªã¹ãã®ã¿ãè¨è¿°ããã¦ãã¾ãã
ããã¯ããã¤ã»ã»ã»('A`)
ã³ã¡ã³ããè¦ã㨠linespacing ãæå®ãããã¨ã§ã縦ã®ééã¯ãããããã¨ãåããã¾ããï¼$extrainfo = Array("linespacing" => 1); ã渡ã)ãããæåã®å·¦å³ã®ééãå¼ããªãã·ã§ã³ã¯ããã®ããªãã®ãä¸æã»ã»ã»ã»ãªã®ã§ PHP ã®ã½ã¼ã¹ã追ãããã¾ãã
ext/gd/gd.c L.4250ãphp_imagettftext_common é¢æ°ã«ã¦
if (extended && EXT) { /* parse extended info */ HashPosition pos; /* walk the assoc array */ zend_hash_internal_pointer_reset_ex(HASH_OF(EXT), &pos); do { zval ** item; char * key; ulong num_key; if (zend_hash_get_current_key_ex(HASH_OF(EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { continue; } if (zend_hash_get_current_data_ex(HASH_OF(EXT), (void **) &item, &pos) == FAILURE) { continue; } if (strcmp("linespacing", key) == 0) { convert_to_double_ex(item); strex.flags |= gdFTEX_LINESPACE; strex.linespacing = Z_DVAL_PP(item); } } while (zend_hash_move_forward_ex(HASH_OF(EXT), &pos) == SUCCESS); }
ã©ãè¦ã¦ã linespacing ããå®ç¾©ããã¦ãã¾ãããæ¬å½ã«ãï½ï¼ï½ï½