8231556: Wrong font ligatures used when 2 versions of same font used

Reviewed-by: serb, kcr
This commit is contained in:
Phil Race 2019-12-19 15:36:40 -08:00
parent 9628324ae7
commit d86eb1de69

View File

@ -41,12 +41,19 @@ public abstract class PhysicalFont extends Font2D {
protected Object nativeNames;
public boolean equals(Object o) {
return (o != null && o.getClass() == this.getClass() &&
((Font2D)o).fullName.equals(this.fullName));
if (o == null || o.getClass() != this.getClass()) {
return false;
}
PhysicalFont other = (PhysicalFont)o;
return
(this.fullName.equals(other.fullName)) &&
((this.platName == null && other.platName == null) ||
(this.platName != null && this.platName.equals(other.platName)));
}
public int hashCode() {
return fullName.hashCode();
return fullName.hashCode() +
(platName != null ? platName.hashCode() : 0);
}
/**