Git Product home page Git Product logo

Comments (10)

MasterQ32 avatar MasterQ32 commented on May 25, 2024 2

Hey!
I'm kinda busy right now, but following the issues here anyways. QFont::insertSubstitutions sounds like a good solution to me

Interesting solution. Doesn't rely on the user having one of those fonts installed though? Might be better to package one with Kristall. I also think it'd be good to add Noto Color Emoji there too.

Yeah that would've been my plan here. Package a emoji font and set it as substitutions.

The load/save/apply workflow is strange and buggy. I don't know where the theme files are stored, but they survive a recompile on my system. I wish that was a bit clearer. They're not in ~/.config as far as I can see.

Can you please make a separate issue for that? I tested loading/saving, but i changed a whole lot of stuff there. Themes are stored in ~/config/kristall/themes as files, you should be able to drop the themes just in there...

from kristall.

makew0rld avatar makew0rld commented on May 25, 2024

It'd be nice if twemoji was included or something to guarantee emojis across all platforms and font setups.

from kristall.

makew0rld avatar makew0rld commented on May 25, 2024

This bug appears to be caused by Kristall not switching fonts when an emoji is in the text. Most fonts don't support emojis, and so I can't get them to display. I was able to fix this by setting my font to one of the Noto Emoji fonts, but this isn't a long term solution.

from kristall.

danielledeleo avatar danielledeleo commented on May 25, 2024

Interestingly, the behaviour on macOS is that fonts get an automatic override (apparently at the system level, not sure) and use Apple Color Emoji.

I think a patch to src/documentstyle.cpp in the DocumentStyle constructor roughly around line 155 like this should work:

DocumentStyle::DocumentStyle() : theme(Fixed),
    [...]
    h3_font.setFamily("sans");
    h3_font.setBold(true);
    h3_font.setPointSizeF(16.0);

    QStringList emojiFonts = { "Apple Color Emoji", "Segoe UI Emoji", "Twitter Color Emoji" };
    QFont::insertSubstitutions("sans", emojiFonts);
    QFont::insertSubstitutions("monospace", emojiFonts);
}

from kristall.

danielledeleo avatar danielledeleo commented on May 25, 2024

Oh and I guess you'd also have to call QFont::insertSubstitutions("Fancy User Font", emojiFonts); on custom fonts somewhere too.

from kristall.

makew0rld avatar makew0rld commented on May 25, 2024

Interesting solution. Doesn't rely on the user having one of those fonts installed though? Might be better to package one with Kristall. I also think it'd be good to add Noto Color Emoji there too.

from kristall.

danielledeleo avatar danielledeleo commented on May 25, 2024

I agree, but I think it would be appropriate to leave the included font as the last failover so that the system emoji font is used first. Perhaps that could be a setting as well.

I do think that the whole font and theming system needs a refactor though. The load/save/apply workflow is strange and buggy. I don't know where the theme files are stored, but they survive a recompile on my system. I wish that was a bit clearer. They're not in ~/.config as far as I can see.

from kristall.

MasterQ32 avatar MasterQ32 commented on May 25, 2024

Basic emoji support has landed in 7f0143b. Can you all please test if it works for you?

from kristall.

makew0rld avatar makew0rld commented on May 25, 2024

I built directly from that commit, and for some reason it shows all emojis in a line drawing format, even ones that aren't specced by Unicode as having a line drawn option.

Screenshot_2020-08-17_09-46-35

I am not sure why this is happening as it appears Kristall loads its own font files.

from kristall.

makew0rld avatar makew0rld commented on May 25, 2024

@MasterQ32 Any idea about this? Still experiencing it with the latest commit be06c40.

from kristall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.