Author: tilman
Date: Wed Dec  3 14:38:39 2025
New Revision: 1930229

Log:
PDFBOX-6108: add Colorant and Font types

Added:
   
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/ColorantType.java
   (contents, props changed)
   
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/FontType.java   
(contents, props changed)
Modified:
   
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPageTextSchema.java
   pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/Types.java

Modified: 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPageTextSchema.java
==============================================================================
--- 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPageTextSchema.java
     Wed Dec  3 14:38:29 2025        (r1930228)
+++ 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/schema/XMPageTextSchema.java
     Wed Dec  3 14:38:39 2025        (r1930229)
@@ -49,9 +49,13 @@ public class XMPageTextSchema extends XM
     @PropertyType(type = Types.Text, card = Cardinality.Seq)
     public static final String PLATENAMES = "PlateNames"; // Ordered array of 
Text
 
-    // missing:
-    // Colorants / Ordered array of Colorants / Cardinality.Seq
-    // Fonts / Unordered array of Fonts / Cardinality.Bag
+    // An ordered array of colorants (swatches) that are used in the document
+    @PropertyType(type = Types.Colorant, card = Cardinality.Seq)
+    public static final String COLORANTS = "Colorants"; // Ordered array of 
Colorants
+
+    // An unordered array of fonts that are used in the document
+    @PropertyType(type = Types.Font, card = Cardinality.Bag)
+    public static final String FONTS = "Fonts"; // Unordered array of Fonts
 
     public XMPageTextSchema(XMPMetadata metadata)
     {

Added: 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/ColorantType.java
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/ColorantType.java
   Wed Dec  3 14:38:39 2025        (r1930229)
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+package org.apache.xmpbox.type;
+
+import org.apache.xmpbox.XMPMetadata;
+
+/**
+ */
+@StructuredType(preferedPrefix = "xmpG",namespace = 
"http://ns.adobe.com/xap/1.0/g/";)
+public class ColorantType extends AbstractStructuredType
+{
+
+    @PropertyType(type = Types.Integer)
+    public static final String A = "A";
+
+    @PropertyType(type = Types.Integer)
+    public static final String B = "B";
+
+    @PropertyType(type = Types.Real)
+    public static final String L = "L";
+
+    @PropertyType(type = Types.Real)
+    public static final String BLACK = "black";
+
+    @PropertyType(type = Types.Real)
+    public static final String CYAN = "cyan";
+
+    @PropertyType(type = Types.Real)
+    public static final String MAGENTA = "magenta";
+
+    @PropertyType(type = Types.Real)
+    public static final String YELLOW = "yellow";
+
+    @PropertyType(type = Types.Integer)
+    public static final String BLUE = "blue";
+
+    @PropertyType(type = Types.Integer)
+    public static final String GREEN = "green";
+
+    @PropertyType(type = Types.Integer)
+    public static final String RED = "red";
+
+    @PropertyType(type = Types.Choice, card = Cardinality.Simple)
+    public static final String MODE = "mode";
+
+    @PropertyType(type = Types.Text)
+    public static final String SWATCH_NAME = "swatchName";
+
+    @PropertyType(type = Types.Choice, card = Cardinality.Simple)
+    public static final String TYPE = "type";
+
+    public ColorantType(XMPMetadata metadata)
+    {
+        super(metadata);
+    }
+}

Added: 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/FontType.java
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/FontType.java   
    Wed Dec  3 14:38:39 2025        (r1930229)
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+package org.apache.xmpbox.type;
+
+import org.apache.xmpbox.XMPMetadata;
+
+/**
+ */
+@StructuredType(preferedPrefix = "stFnt",namespace = 
"http://ns.adobe.com/xap/1.0/sType/Font#";)
+public class FontType extends AbstractStructuredType
+{
+
+    @PropertyType(type = Types.Text, card = Cardinality.Seq)
+    public static final String CHILD_FONT_FILES = "childFontFiles";
+
+    @PropertyType(type = Types.Boolean)
+    public static final String COMPOSITE = "composite";
+
+    @PropertyType(type = Types.Text)
+    public static final String FONT_FACE = "fontFace";
+
+    @PropertyType(type = Types.Text)
+    public static final String FONT_FAMILY = "fontFamily";
+
+    @PropertyType(type = Types.Text)
+    public static final String FONT_FILE_NAME = "fontFileName";
+
+    @PropertyType(type = Types.Text)
+    public static final String FONT_NAME = "fontName";
+
+    @PropertyType(type = Types.Choice, card = Cardinality.Simple)
+    public static final String FONT_TYPE = "fontType";
+
+    @PropertyType(type = Types.Text)
+    public static final String VERSION_STRING = "versionString";
+
+    public FontType(XMPMetadata metadata)
+    {
+        super(metadata);
+    }
+}

Modified: 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/Types.java
==============================================================================
--- pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/Types.java  
Wed Dec  3 14:38:29 2025        (r1930228)
+++ pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/Types.java  
Wed Dec  3 14:38:39 2025        (r1930229)
@@ -35,6 +35,7 @@ public enum Types
             Text, PartType.class), URL(true, Text, URLType.class), URI(true, 
Text, URIType.class), Choice(true, Text,
             ChoiceType.class), MIMEType(true, Text, MIMEType.class), 
LangAlt(true, Text, TextType.class), RenditionClass(
             true, Text, RenditionClassType.class), 
Rational(true,Text,RationalType.class),
+            Colorant(false,Structured,ColorantType.class), 
Font(false,Structured,FontType.class),
 
     Layer(false, Structured, LayerType.class), Thumbnail(false, Structured, 
ThumbnailType.class), ResourceEvent(false,
             Structured, ResourceEventType.class), ResourceRef(false, 
Structured, ResourceRefType.class), Version(false,

Reply via email to