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

Glyphs not in line #2

Closed
ineshbose opened this issue May 20, 2022 · 9 comments
Closed

Glyphs not in line #2

ineshbose opened this issue May 20, 2022 · 9 comments

Comments

@ineshbose
Copy link
Owner

The character seems to be in the correct position, but the glyphs themselves are appearing below the line.

@eburghar
Copy link

eburghar commented Jun 12, 2022

I confirm the bug. I use this as a temporary fix.

\newcommand{\simpleIcon}[1]{%
  \raisebox{1.2\fontcharht\font`0}{%
    \simpleicon{#1}%
  }%
}

@ineshbose
Copy link
Owner Author

Thank you for confirming the bug and using this package - it means a lot.

I'm still investigating for solutions, but I have kept a note for this approach! 😄

@eburghar
Copy link

I think this is a bug with the way the font is constructed. The glyphs are set below the baseline.

@eburghar
Copy link

With the aforementioned fix in the font which should be merged soon, the best way to vertical align the icon with the current font is to is to lower the icon by half of the current font depth (taking y as a reference).

\newcommand{\simpleIcon}[1]{%
	\raisebox{-0.5\fontchardp\font`y}{%
		\simpleicon{#1}%
	}%
}

@ineshbose
Copy link
Owner Author

Tracking PR: simple-icons/simple-icons-font#171

Thank you a lot for this. I'm waiting for this to merge, and then from this end I'm intending to fix this from the opentype.js font construction way (https://github.com/ineshbose/simple-icons-latex/blob/master/bindings.js#L31), but at the moment I'm not finding the right methods to do it. With that said, I really appreciate your efforts, and if you would consider making a PR (with the JS approach if feasible else redefining the command) so that your contribution is noted.

@eburghar
Copy link

Hi,

I don't think you need to do anything on your side. It looks ok without the raisebox. I think this should be done on the font itself glyphs by glyphs as some can look misaligned when lied on the descent line and other if lied on the baseline.

If you don't want to wait for the merge, as the font is included in the CTAN package, you can just build the font with the merge applied, copy the otf locally, and loadSync("SimpleIcons.otf") in the binding.js. That's what I did.

@ineshbose
Copy link
Owner Author

Thanks for the suggestion! That is definitely one fix along with using the raisebox which one can use temperarily but for the package and developer convenience, it is best that everything is handled by itself without requiring additional configuration or work. I see that the issue has been closed in simple-icons-font, and so I am just waiting for the pipeline to also automatically update to that version so that this can be confirmed to be fixed for this package as well and closed off!

@ineshbose
Copy link
Owner Author

Sorry for taking a while! Package has finally been updated and this is now confirmed to be fix. Thank you very much for your contribution and patience. Closing!

@ineshbose
Copy link
Owner Author

I want to confirm from users - is this fixed? I noticed that if I compare it to fontawesome5, for example, it's still not in baseline.

image

MWE:

\documentclass{article}
\usepackage{simpleicons}
\usepackage{fontawesome5}

\begin{document}

\faBitbucket
\simpleicon{bitbucket}

\end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants