Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / file_mdm / file_mdm_font / README.md
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 (file)
index 0000000..0503627
--- /dev/null
@@ -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          |