Skip to content

Commit a3661a5

Browse files
Sonia Zaldana Callesjerboaa
Sonia Zaldana Calles
authored andcommittedNov 28, 2023
8231556: Wrong font ligatures used when 2 versions of same font used
Backport-of: d86eb1de69c2f5e3e9388c61ed6c5d928dc17d20
1 parent f65058e commit a3661a5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎src/java.desktop/share/classes/sun/font/PhysicalFont.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,19 @@ public abstract class PhysicalFont extends Font2D {
4141
protected Object nativeNames;
4242

4343
public boolean equals(Object o) {
44-
return (o != null && o.getClass() == this.getClass() &&
45-
((Font2D)o).fullName.equals(this.fullName));
44+
if (o == null || o.getClass() != this.getClass()) {
45+
return false;
46+
}
47+
PhysicalFont other = (PhysicalFont)o;
48+
return
49+
(this.fullName.equals(other.fullName)) &&
50+
((this.platName == null && other.platName == null) ||
51+
(this.platName != null && this.platName.equals(other.platName)));
4652
}
4753

4854
public int hashCode() {
49-
return fullName.hashCode();
55+
return fullName.hashCode() +
56+
(platName != null ? platName.hashCode() : 0);
5057
}
5158

5259
/**

0 commit comments

Comments
 (0)