Ngày: Tháng 10 7, 2024

Đếm số lượng glyphs của font bằng FontLib

Đoạn code ví dụ cách đếm glyphs của font bằng cách sử dụng tiện ích FontLib. $font_file = get_post_meta( $post_id, ‘font_file’, true ); if ( $this->is_media_file_exists( $font_file ) ) { $font = FontLib\Font::load( get_attached_file( $font_file ) ); $font->parse(); $table = $font->getTableObject( ‘maxp’ ); $glyphs = $table->data[‘numGlyphs’] ?? ”; } Đầu vào là chúng ta có […]