diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarne.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarne.java new file mode 100644 index 0000000..cbafa26 --- /dev/null +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarne.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2004-2014, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.x4o.fc18.cake2; + +/// Quad corner kerning support for pattern letters. +/// +/// @author Willem Cazander +/// @version 1.0 Jan 18, 2025 +public interface FourCornerX00PetitVideCoinCarne extends FourCornerX00PetitVidePoints { + + FourCornerX00PetitVideCoinCarneFrapper petitVideCoinCarneFrapper(); +} diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarneFrapper.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarneFrapper.java new file mode 100644 index 0000000..b6bcc6e --- /dev/null +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarneFrapper.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2004-2014, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.x4o.fc18.cake2; + +import java.util.Objects; + +/// Quad corner kerning support for pattern letters. +/// +/// @author Willem Cazander +/// @version 1.0 Jan 19, 2025 +public final class FourCornerX00PetitVideCoinCarneFrapper { + + private final FourCornerX00PetitVideCoinCarneFrapperRetrait kerningTop; + private final FourCornerX00PetitVideCoinCarneFrapperRetrait kerningBottom; + + private FourCornerX00PetitVideCoinCarneFrapper(FourCornerX00PetitVideCoinCarneFrapperRetrait kerningTop, FourCornerX00PetitVideCoinCarneFrapperRetrait kerningBottom) { + this.kerningTop = Objects.requireNonNull(kerningTop); + this.kerningBottom = Objects.requireNonNull(kerningBottom); + } + + public FourCornerX00PetitVideCoinCarneFrapperRetrait kerningTop() { + return kerningTop; + } + + public FourCornerX00PetitVideCoinCarneFrapperRetrait kerningBottom() { + return kerningBottom; + } + + static public FourCornerX00PetitVideCoinCarneFrapper valueForQuad(FourCornerX00PetitVideCoinCarneFrapperRetrait kerningTop, FourCornerX00PetitVideCoinCarneFrapperRetrait kerningBottom) { + return new FourCornerX00PetitVideCoinCarneFrapper(kerningTop, kerningBottom); + } + + static public FourCornerX00PetitVideCoinCarneFrapper valueForNone() { + return valueForQuad(FourCornerX00PetitVideCoinCarneFrapperRetrait.valueNone(), FourCornerX00PetitVideCoinCarneFrapperRetrait.valueNone()); + } + + static public FourCornerX00PetitVideCoinCarneFrapper valueOnlyTop(FourCornerX00PetitVideCoinCarneFrapperRetrait kerningTop) { + return valueForQuad(kerningTop, FourCornerX00PetitVideCoinCarneFrapperRetrait.valueNone()); + } + + static public FourCornerX00PetitVideCoinCarneFrapper valueOnlyBottom(FourCornerX00PetitVideCoinCarneFrapperRetrait kerningBottom) { + return valueForQuad(FourCornerX00PetitVideCoinCarneFrapperRetrait.valueNone(), kerningBottom); + } +} diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarneFrapperRetrait.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarneFrapperRetrait.java new file mode 100644 index 0000000..dcc97e7 --- /dev/null +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVideCoinCarneFrapperRetrait.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2004-2014, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.x4o.fc18.cake2; + +/// Quad corner kerning indent indicator. +/// +/// @author Willem Cazander +/// @version 1.0 Jan 19, 2025 +public enum FourCornerX00PetitVideCoinCarneFrapperRetrait { + + NONE, + + CENTER_10, + CENTER_20, + CENTER_30, + CENTER_40, + + LEFT_10, + LEFT_20, + LEFT_30, + LEFT_40, + + RIGHT_10, + RIGHT_20, + RIGHT_30, + RIGHT_40, + ; + + private FourCornerX00PetitVideCoinCarneFrapperRetrait() { + } + + static public FourCornerX00PetitVideCoinCarneFrapperRetrait valueNone() { + return NONE; + } +} diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVidePoints.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVidePoints.java index d552b0c..b2913c2 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVidePoints.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerX00PetitVidePoints.java @@ -44,6 +44,10 @@ public interface FourCornerX00PetitVidePoints { return this instanceof FourCornerX21CodePoints; } + default boolean isCoinCarne() { + return this instanceof FourCornerX00PetitVideCoinCarne; + } + default FourCornerX06BaklavaPoints toX06() { return FourCornerX06BaklavaPoints.class.cast(this); } @@ -59,4 +63,8 @@ public interface FourCornerX00PetitVidePoints { default FourCornerX21CodePoints toX21() { return FourCornerX21CodePoints.class.cast(this); } + + default FourCornerX00PetitVideCoinCarne toCoinCarne() { + return FourCornerX00PetitVideCoinCarne.class.cast(this); + } } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotCDC1604DashP6.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotCDC1604DashP6.java index 8db310a..83d7502 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotCDC1604DashP6.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/FCDotCDC1604DashP6.java @@ -22,6 +22,9 @@ */ package org.x4o.fc18.cake2.zero33; +import org.x4o.fc18.cake2.FourCornerX00PetitVideCoinCarne; +import org.x4o.fc18.cake2.FourCornerX00PetitVideCoinCarneFrapper; +import org.x4o.fc18.cake2.FourCornerX00PetitVideCoinCarneFrapperRetrait; import org.x4o.fc18.cake2.FourCornerX06BaklavaPoints; import org.x4o.fc18.cake2.FourCornerX08MuffinPoints; import org.x4o.fc18.cake2.FourCornerX18CakePoints; @@ -40,7 +43,7 @@ import org.x4o.fc18.cake2.FourCornerX21CodePoints; /// @author Willem Cazander /// @version 1.0 Dec 22, 2024 /// -public enum FCDotCDC1604DashP6 implements FourCornerX06BaklavaPoints, FourCornerX08MuffinPoints, FourCornerX18CakePoints, FourCornerX21CodePoints { +public enum FCDotCDC1604DashP6 implements FourCornerX06BaklavaPoints, FourCornerX08MuffinPoints, FourCornerX18CakePoints, FourCornerX21CodePoints, FourCornerX00PetitVideCoinCarne { // [__NUL][__PIE68][__NCR68][__ESC6] [_NEWLINE][_SPACE]?! <>[] (){} // ~+-* ,.:; '"`^ =#$% // |_\/ @ABC DEFG HIJK @@ -147,6 +150,39 @@ public enum FCDotCDC1604DashP6 implements FourCornerX06BaklavaPoints, FourCorner return new int[] {codePoint}; } + @Override + public FourCornerX00PetitVideCoinCarneFrapper petitVideCoinCarneFrapper() { + // TODO: Add kerning for symbols too + if (this == NX01_A) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyTop(FourCornerX00PetitVideCoinCarneFrapperRetrait.CENTER_20); + } + if (this == NX06_F) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyBottom(FourCornerX00PetitVideCoinCarneFrapperRetrait.RIGHT_10); + } + if (this == NX09_I) { + return FourCornerX00PetitVideCoinCarneFrapper.valueForQuad(FourCornerX00PetitVideCoinCarneFrapperRetrait.CENTER_10, FourCornerX00PetitVideCoinCarneFrapperRetrait.CENTER_10); + } + if (this == NX10_J) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyTop(FourCornerX00PetitVideCoinCarneFrapperRetrait.LEFT_10); + } + if (this == NX12_L) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyTop(FourCornerX00PetitVideCoinCarneFrapperRetrait.RIGHT_20); + } + if (this == NX16_P) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyBottom(FourCornerX00PetitVideCoinCarneFrapperRetrait.RIGHT_10); + } + if (this == NX20_T) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyBottom(FourCornerX00PetitVideCoinCarneFrapperRetrait.CENTER_20); + } + if (this == NX22_V) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyBottom(FourCornerX00PetitVideCoinCarneFrapperRetrait.CENTER_20); + } + if (this == NX25_Y) { + return FourCornerX00PetitVideCoinCarneFrapper.valueOnlyBottom(FourCornerX00PetitVideCoinCarneFrapperRetrait.CENTER_20); + } + return FourCornerX00PetitVideCoinCarneFrapper.valueForNone(); + } + static public int valuesLength() { return VALUES.length; } diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java index 4f79384..ab3b86a 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java @@ -25,6 +25,7 @@ package org.x4o.fc18.cake2.fcdoc; import java.io.IOException; import java.util.Arrays; +import org.x4o.fc18.cake2.FourCornerX00PetitVideCoinCarne; import org.x4o.fc18.cake2.FourCornerX00PetitVidePoints; import org.x4o.o2o.io.ContentWriterHtml.Tag; import org.x4o.o2o.tdoc.ApiDocContentCss; @@ -65,6 +66,11 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter { if (videPoint.isX21()) { writeSequence(writer, "X21", videPoint.toX21().codePoints()); } + if (videPoint.isCoinCarne()) { + FourCornerX00PetitVideCoinCarne cornerKerning = videPoint.toCoinCarne(); + writer.docTableRow("Kerning Top", cornerKerning.petitVideCoinCarneFrapper().kerningTop().name()); + writer.docTableRow("Kerning Bottom", cornerKerning.petitVideCoinCarneFrapper().kerningBottom().name()); + } writer.docTableEnd(); }