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

Invalid default avatar of new account with display name in Unicode #13376

Closed
1ndahous3 opened this issue Jan 4, 2019 · 14 comments
Closed

Invalid default avatar of new account with display name in Unicode #13376

1ndahous3 opened this issue Jan 4, 2019 · 14 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@1ndahous3
Copy link

NC 15.0.0
Firefox 64.0

Steps to reproduce

  1. Add user with display name in Unicode
  2. Log in
  3. Look at the avatar

image

@1ndahous3 1ndahous3 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 4, 2019
@rullzer
Copy link
Member

rullzer commented Jan 7, 2019

@skjnldsv

@skjnldsv
Copy link
Member

skjnldsv commented Jan 7, 2019

I'm guessing our font does not support this, so we need a default font then?

@skjnldsv
Copy link
Member

skjnldsv commented Jan 7, 2019

@R0maNNN After some tests, I can't reproduce. Do you have Chinese fonts installed on your machine?
You have imagick installed on php as well, correct?

@1ndahous3
Copy link
Author

@skjnldsv it's a docker container.

docker-compose.yml (reduced):

version: '3'

services:
  db:
    image: postgres:alpine
    restart: always
    volumes:
      - db:/var/lib/postgresql/data
    env_file:
      - db.env

  redis:
    image: redis
    restart: always

  app:
    image: nextcloud:fpm-alpine
    restart: always
    volumes:
      - nextcloud:/var/www/html
    environment:
      - POSTGRES_HOST=db
    env_file:
      - db.env
    depends_on:
      - db
      - redis

  cron:
    build: ./app
    restart: always
    volumes:
      - nextcloud:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis

  web:
    build: ./web
    restart: always
    ports:
      - 80:80
    volumes:
      - nextcloud:/var/www/html:ro
    depends_on:
      - app

volumes:
  nextcloud:
  db:

@KekcuHa
Copy link

KekcuHa commented Feb 5, 2019

I faced the same issue: avatars for Cyrillic user names are question sign ('?') in NC 15.

I have a guess: lib/private/Avatar.php contains the following code with hard-coded font-face name, but Nunito-Regular.ttf contains latin characters only.

Also i guess that's the same reason for folders contains Latin character are displays with different font regarding to folder names contains only Latin characters.

Anyway, selection of the font that does not contain common Unicode blocks can cause a lot of different issues.

private function generateAvatar($userDisplayName, $size) {
    …
    $font = __DIR__ . '/../../core/fonts/Nunito-Regular.ttf';
    …
    imagettftext($im, $fontSize, 0, $x, $y, $white, $font, $text);
    …

@skjnldsv
Copy link
Member

skjnldsv commented Feb 5, 2019

cc @jancborchardt :)

@jancborchardt
Copy link
Member

This seems to be very related to #11640 (comment)

There it was proposed to add Noto Sans TC as a fallback. (Noto Sans is almost the same as Open Sans, the font we used before and might move to again actually.)

Could you confirm that this would work for you? I don’t know if the preview function can handle multiple fonts though so that might need to be added? @skjnldsv

@kesselb
Copy link
Contributor

kesselb commented Feb 13, 2019

I faced the same issue: avatars for Cyrillic user names are question sign ('?') in NC 15.

#13377 (i guess we could update the ttf but we have to wait for the google font pull request for woff)

@hbqclh
Copy link

hbqclh commented Mar 19, 2019

image

@ghost
Copy link

ghost commented Jun 12, 2019

This issue has been automatically marked as stale because it has not had recent activity and it seems to be missing some essential informations. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Jun 12, 2019
@skjnldsv
Copy link
Member

Let's close in favour of #13377

@skjnldsv skjnldsv removed needs info stale Ticket or PR with no recent activity labels Jun 12, 2019
@1ndahous3
Copy link
Author

@skjnldsv I do not think that this is the same error, in #13377 the characters are heterogeneous, but readable, in this case the characters are not readable.

Can you reproduce this by docker compose? I wrote the config above.

@skjnldsv
Copy link
Member

@R0maNNN no, it's linked together.
By adding more font (cyrilic, chinese...) our avatar generator will be able to properly render them :)

@jancborchardt
Copy link
Member

I’d say that the more relevant issue is #4198, since it also deals with previews.

I’m about to open a pull request to switch to Noto Sans, which will at least fix the issue for Cyrillic and some other character sets. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

7 participants