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

t-vim: Problem with hyphens (TeX ligatures present in teletype fonts) #26

Closed
Goshik92 opened this issue Oct 25, 2018 · 4 comments
Closed

Comments

@Goshik92
Copy link

When my code contains multiple hyphens in a row, they are replaced with longer dashes. For example, in C code instead of i-- I have i–. Some of my comments also look incorrectly:

/*———————————————————————————-
* File: main.c
* Function: foo
* Description: bar
...

instead of

/*----------------------------------------------------------------------------------
* File: main.c
* Function: foo
* Description: bar
...

Is there a way to control this or is it a bug?

@adityam
Copy link
Owner

adityam commented Apr 7, 2019

This is most likely due to a font misconfiguration. Can you post a minimal example showing the bug.

@Goshik92
Copy link
Author

You seem to be right about font issues. In the following code if I comment out \definefontfamily [mainface] [tt] [Consolas], I see normal dashes. Is it an issue with Consolas font?

test.tex:

% Choose US paper format
\setuppapersize[letter]

\definefontfamily [mainface] [rm] [Cambria]
\definefontfamily [mainface] [ss] [Calibri]
\definefontfamily [mainface] [tt] [Consolas]
\definefontfamily [mainface] [mm] [Asana Math]
\setupbodyfont[mainface]

\usemodule[vim]

\definevimtyping[C][
	syntax=c,
	numbering=yes]
    

\starttext
\typeCfile{main.c}
\stoptext

main.c:

/*----------------------------------------------------------------------------------
* File: main.c
* Function: foo
* Description: bar
*----------------------------------------------------------------------------------*/

void main()
{
    int i = 0;
    i--;
    return 0;
}

@adityam
Copy link
Owner

adityam commented Jun 1, 2019

I cannot test this right now, but try by adding features=none to disable ligatures for teletype fonts.

\definefontfamily [mainface] [tt] [Consolas][features=none]

@Goshik92
Copy link
Author

Goshik92 commented Jun 1, 2019

[features=none] solves the problem. Thank you so much for your help!

@Goshik92 Goshik92 closed this as completed Jun 1, 2019
@adityam adityam changed the title t-vim: Problem with hyphens t-vim: Problem with hyphens (TeX ligatures present in teletype fonts) Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants