JDK-8239890 : Freetype bytecode interpreter override does not work
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 11.0.6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_oracle_6.0
  • CPU: x86
  • Submitted: 2020-02-23
  • Updated: 2020-02-25
  • Resolved: 2020-02-25
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Any version above jdk-11.0.6+1
JDK 8 is affected too.

A DESCRIPTION OF THE PROBLEM :
Environment variable does not override freetype interpreter version anymore

REGRESSION : Last worked in version 11.0.6

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start GUI app
export FREETYPE_PROPERTIES="truetype:interpreter-version=40"
Start GUI app again

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Font rendering changed
ACTUAL -
Font rendering does not change

CUSTOMER SUBMITTED WORKAROUND :
src/java.desktop/share/native/libfontmanager/freetypeScaler.c

```
    char* props = getenv("FREETYPE_PROPERTIES");
    int version = 35;
    const char* module = "truetype";
    const char* property = "interpreter-version";

    /* If some one is setting this, don't override it */
    if (props != NULL && strstr(property, props)) {
        return;
    }
```

strstr (3) is misused. 
Correct use would be `strstr(props, property)`

Due to:
STRSTR(3)
char *strstr(const char *haystack, const char *needle);
The strstr() function finds the first occurrence of the substring needle in the string haystack.
char *strstr(const char *haystack, const char *needle);

FREQUENCY : always



Comments
This is a duplicate of JDK-8239091.
25-02-2020