All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.humbleui.skija.FontStyle Maven / Gradle / Ivy

There is a newer version: 0.116.2
Show newest version
// Generated by delombok at Mon Dec 20 14:13:09 UTC 2021
package io.github.humbleui.skija;

import org.jetbrains.annotations.*;

public class FontStyle {
    public final int _value;
    public static final FontStyle NORMAL = new FontStyle(FontWeight.NORMAL, FontWidth.NORMAL, FontSlant.UPRIGHT);
    public static final FontStyle BOLD = new FontStyle(FontWeight.BOLD, FontWidth.NORMAL, FontSlant.UPRIGHT);
    public static final FontStyle ITALIC = new FontStyle(FontWeight.NORMAL, FontWidth.NORMAL, FontSlant.ITALIC);
    public static final FontStyle BOLD_ITALIC = new FontStyle(FontWeight.BOLD, FontWidth.NORMAL, FontSlant.ITALIC);

    public FontStyle(int weight, int width, FontSlant slant) {
        _value = (weight & 65535) | ((width & 255) << 16) | (slant.ordinal() << 24);
    }

    @ApiStatus.Internal
    public FontStyle(int value) {
        this._value = value;
    }

    public int getWeight() {
        return _value & 65535;
    }

    public FontStyle withWeight(int weight) {
        return new FontStyle(weight, getWidth(), getSlant());
    }

    public int getWidth() {
        return (_value >> 16) & 255;
    }

    public FontStyle withWidth(int width) {
        return new FontStyle(getWeight(), width, getSlant());
    }

    public FontSlant getSlant() {
        return FontSlant._values[(_value >> 24) & 255];
    }

    public FontStyle withSlant(FontSlant slant) {
        return new FontStyle(getWeight(), getWidth(), slant);
    }

    @Override
    public String toString() {
        return "FontStyle(" + "weight=" + getWeight() + ", width=" + getWidth() + ", slant=\'" + getSlant() + ')';
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof FontStyle)) return false;
        final FontStyle other = (FontStyle) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (this._value != other._value) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof FontStyle;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this._value;
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy