X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Ffile_mdm%2Ffile_mdm_font%2FREADME.md;fp=web%2Fmodules%2Fcontrib%2Ffile_mdm%2Ffile_mdm_font%2FREADME.md;h=05036276c92a69fc69e137ede5b374cc9f86c051;hp=0000000000000000000000000000000000000000;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/file_mdm/file_mdm_font/README.md b/web/modules/contrib/file_mdm/file_mdm_font/README.md new file mode 100644 index 000000000..05036276c --- /dev/null +++ b/web/modules/contrib/file_mdm/file_mdm_font/README.md @@ -0,0 +1,68 @@ +# File metadata Font + +A Drupal 8 module providing a file metadata plugin to retrieve information from +font files. + + +## Features: + +Uses the [PHP Font Lib](https://github.com/PhenX/php-font-lib) to read font +information from TTF/OTF/WOFF font files. + + +## Usage examples: + +1. Use the _file_metadata_manager_ service to prepare collecting metadata for + the font located at a desired URI: + + ```php + $fmdm = \Drupal::service('file_metadata_manager'); + $my_font_metadata = $fmdm->uri('public::/my_font_directory/arial.ttf'); + ... + ``` + +2. Get the value of a key: + + ```php + ... + $font_name = $my_font_metadata->getMetadata('font', 'FontName'); + ... + ``` + +3. Get an array with all the metadata values: + + ```php + ... + $my_font_info = []; + foreach ($my_font_metadata->getSupportedKeys('font') as $key) { + $my_font_info[$key] = $my_font_metadata->getMetadata('font', $key); + } + ... + ``` + + +## Available metadata keys: + +Key | +--------------------| +FontType | +FontWeight | +Copyright | +FontName | +FontSubfamily | +UniqueID | +FullName | +Version | +PostScriptName | +Trademark | +Manufacturer | +Designer | +Description | +FontVendorURL | +FontDesignerURL | +LicenseDescription | +LicenseURL | +PreferredFamily | +PreferredSubfamily | +CompatibleFullName | +SampleText |