Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8269806: Emoji rendering on Linux #4798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

8269806: Emoji rendering on Linux #4798

wants to merge 1 commit into from

Conversation

@YaaZ
Copy link
Contributor

@YaaZ YaaZ commented Jul 15, 2021

It was implemented in JetBrains Runtime a year ago and was ported & refactored for this PR
It includes:

  • Bitmap glyph loading via Freetype
  • Manual scaling & transformation of bitmap glyphs with nearest-neighbor or bilinear-mipmap style algorithms depending on the text antialiasing hint
  • Storing BGRA glyphs in glyph cache & rendering them as plain images, as currently used XRender text drawing functions doesn't support colored glyphs
  • Small fixes in related code like null-checks which could cause NPE & comment typos

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4798/head:pull/4798
$ git checkout pull/4798

Update a local copy of the PR:
$ git checkout pull/4798
$ git pull https://git.openjdk.java.net/jdk pull/4798/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4798

View PR using the GUI difftool:
$ git pr show -t 4798

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4798.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 15, 2021

👋 Welcome back YaaZ! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Jul 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 15, 2021

@YaaZ The following labels will be automatically applied to this pull request:

  • 2d
  • awt

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 15, 2021

Webrevs

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 12, 2021

@YaaZ This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@YaaZ
Copy link
Contributor Author

@YaaZ YaaZ commented Aug 22, 2021

@prrace could you take a look, please?

@prrace
Copy link
Contributor

@prrace prrace commented Aug 22, 2021

I'm in the early stages but

  1. It doesn't build on the OL6.4 "official" build environment (note SFAIK the latest info
    is still here : https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms)

Maybe there'll be an update for JDK 18 but it hasn't happened yet

src/java.desktop/share/native/libfontmanager/freetypeScaler.c:1193:24: error: 'FT_LOAD_COLOR' undeclared (first use in this function)
renderFlags |= FT_LOAD_COLOR;
^~~~~~~~~~~~~
src/java.desktop/share/native/libfontmanager/freetypeScaler.c:1193:24: note: each undeclared identifier is reported only once for each function it appears in
src/java.desktop/share/native/libfontmanager/freetypeScaler.c:1259:50: error: 'FT_PIXEL_MODE_BGRA' undeclared (first use in this function); did you mean 'FT_PIXEL_MODE_GRAY'?
} else if (ftglyph->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA) {
^~~~~~~~~~~~~~~~~~
FT_PIXEL_MODE_GRAY

At the very least this means you will need to include defines for these if they aren't defined and make sure
that symbols that may be similarly from a later freetype than available on older linuxes are loaded dynamically
and the support skipped where it doesn't exist.

  1. I see Xrender code changes but am wondering what happens with the X11 and OpenGL pipelines ?
    Errors of some code ? Silently behaves like this new code doesn't exist ?

OK I can partially answer that one - garbage rendering with X11 on Ubuntu 20.04

Looks like you are supplying the BRGA glyphs but no loops to handle it.

This needs to be implemented for X11 and OpenGL

@prrace
Copy link
Contributor

@prrace prrace commented Aug 23, 2021

In addition I think the test is a bit flaky
"Noto Color Emoji" may not be available on all Linuxes and for whatever reason your update makes the test fail on Mac.
test result: Error. can't find Emoji in test directory or libraries

So lots to do here before I look again.

@openjdk openjdk bot added the client label Sep 10, 2021
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 20, 2021

@YaaZ This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@miurahr
Copy link

@miurahr miurahr commented Oct 12, 2021

"Noto Color Emoji" may not be available on all Linuxes and for whatever reason your update makes the test fail on Mac.

@YaaZ Any progress do you have? As Linux user I'd like to help if I can.

@prrace
Copy link
Contributor

@prrace prrace commented Oct 30, 2021

@YaaZ nothing has really happened here in > 2 months. When can we expect an update ?

@YaaZ
Copy link
Contributor Author

@YaaZ YaaZ commented Nov 8, 2021

Hi! Sorry, just was busy with other work, but I'm going to get back to this in 1-2 weeks. BTW in the meantime I implemented emoji for JetBrains Runtime on Windows and will create a PR here after I deal with this one.

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 6, 2021

@YaaZ This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@YaaZ
Copy link
Contributor Author

@YaaZ YaaZ commented Dec 29, 2021

Hi @prrace! By X11 pipeline, do you mean -Dsun.java2d.xrender=false? Because I wasn't able to reproduce this on Ubuntu 20.04

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 26, 2022

@YaaZ This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants