| •1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
package com.github.weisj.jsvg.attributes.font; |
| 23 |
|
| 24 |
import java.util.Arrays; |
| 25 |
import java.util.Objects; |
| 26 |
|
| 27 |
import org.jetbrains.annotations.NotNull; |
| 28 |
import org.jetbrains.annotations.Nullable; |
| 29 |
|
| 30 |
import com.github.weisj.jsvg.geometry.size.Length; |
| 31 |
import com.github.weisj.jsvg.geometry.size.Percentage; |
| 32 |
|
| 33 |
public class FontSpec { |
| 34 |
protected final @NotNull String[] families; |
| 35 |
protected final @Nullable FontStyle style; |
| 36 |
protected final @Nullable Length sizeAdjust; |
| 37 |
protected final @NotNull Percentage stretch; |
| 38 |
|
| 39 |
FontSpec(@NotNull String[] families, @Nullable FontStyle style, @Nullable Length sizeAdjust, |
| 40 |
@NotNull Percentage stretch) { |
| 41 |
this.families = families; |
| 42 |
this.style = style; |
| 43 |
this.sizeAdjust = sizeAdjust; |
| 44 |
this.stretch = stretch; |
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
public String toString() { |
| 49 |
return "FontSpec{" + |
| 50 |
"families=" + Arrays.toString(families) + |
| 51 |
", style=" + style + |
| 52 |
", sizeAdjust=" + sizeAdjust + |
| 53 |
", stretch=" + stretch + |
| 54 |
'}'; |
| 55 |
} |
| 56 |
|
| 57 |
@Override |
| 58 |
public boolean equals(Object o) { |
| 59 |
if (this == o) return true; |
| 60 |
if (!(o instanceof FontSpec)) return false; |
| 61 |
FontSpec fontSpec = (FontSpec) o; |
| 62 |
return Objects.equals(stretch, fontSpec.stretch) |
| 63 |
&& Arrays.equals(families, fontSpec.families) |
| 64 |
&& Objects.equals(style, fontSpec.style) |
| 65 |
&& Objects.equals(sizeAdjust, fontSpec.sizeAdjust); |
| 66 |
} |
| 67 |
|
| 68 |
@Override |
| 69 |
public int hashCode() { |
| 70 |
int result = Objects.hash(style, sizeAdjust, stretch); |
| 71 |
result = 31 * result + Arrays.hashCode(families); |
| 72 |
return result; |
| 73 |
} |
| 74 |
} |