-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
LaTeX \textit{..}
is not redered correctly in Main table
#3356
Comments
\textit{..}
is not redered correctly in Main table on OSX
This issue seems not related to JabRef. It is related to Note that I see the correctly rendered label in the debugger. So the Unicode conversion is correct There are several similar issues on SO but none fits to such a simple example. Can someone on OS X try this by creating a class in the jabref package and pasting the content? package org.jabref;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import org.jabref.model.strings.LatexToUnicodeAdapter;
public class SwingJLabelTester extends JPanel{
private SwingJLabelTester() {
super(new GridLayout(3,1)); //3 rows, 1 column
final String latexString = LatexToUnicodeAdapter.format("This is a \\textit{test for italics} and \\textbf{a test for bold}");
final JLabel label = new JLabel(latexString, SwingConstants.CENTER);
label.setVerticalTextPosition(SwingConstants.BOTTOM);
label.setHorizontalTextPosition(SwingConstants.CENTER);
add(label);
}
private static void createAndShowGUI() {
final JFrame frame = new JFrame("LabelDemo");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.add(new SwingJLabelTester());
frame.setSize(400,400);
frame.setVisible(true);
}
public static void main(final String[] args) {
SwingUtilities.invokeLater(SwingJLabelTester::createAndShowGUI);
}
} |
The problem reminded me of the issue #2784 and the follow up discussion we had on this. |
See discussion here: I thought this was fixed with #3008, but I encounter this issue again in: Could it be that when reinstalling a new version of JabRef, old preferences for system fonts are imported, which cause the issue (see also #3008)? |
@Siedlerchr @AEgit Oh god, this is a lot of information. I only skimmed over some issues to see if this has been reported recently. This quote from @lenhard
It was my first guess as well and I tried different settings but nothing helped. That's why I implemented the test-class. Additionally, I read through some SO posts and finally asked with this minimal example here. When it is indeed a font issue that comes and goes with setting different fonts it would be bad since users can change this as they like. Since the main table is only displayed and not edited directly, would it be an option to use HTML like we do in the preview? |
HTML could be an option, should be possible, https://docs.oracle.com/javase/tutorial/uiswing/components/html.html |
Maybe a stupid question: Was there a reason for why HTML wasn't used in the first place for the main table? Could this influence the performance in large databases? |
The first time I started (after new installation) JabRef 4.1-dev--snapshot--2017-10-26--master--3d4b5104d this issue seemed to be fixed, i. e. the The second time I started the same JabRef version, the issue reported above reappeared, i. e. text that should render in italics is replaced by squares in the main table. This issue persists when restarting JabRef. This indicates, I guess, that something changes in the default settings between the first installation of JabRef and subsequent use. |
We could use the latex2html converter, similar as in #3574 |
\textit{..}
is not redered correctly in Main table on OSX\textit{..}
is not redered correctly in Main table
This should be fixed in the latest development version. Could you please check the build from https://builds.jabref.org/maintable-beta/. Thanks! Note this version is in a very early beta stage and might not work as expected. See #3621 for further details. |
I can confirm that this has been fixed in: JabRef 4.2-dev--snapshot--2018-01-30--maintable-beta--85342350f Thank you for your help! Note, however, that the performance of the search has dropped significantly in the new build and other issues appear to persist (see #1513 (comment)). |
Unfortunately, the problem still exists with |
@tolot27 You are using the wrong branch. This is not yet in master, but in the maintable-beta branch linked by @tobiasdiez above. |
I've tried the maintable-beta branch but the problem persists. |
As the discussion in #4236 shows, more users have problems with italics even with the new master branch. I'll thus reopen it. Probably, it depends on the active (system?) font. |
Cannot reproduce this issue for: JabRef 5.0-dev--snapshot--2018-07-25--master--077fdacc2 Note, however, my post here: #3356 (comment) |
I tested it with 4.3.1 and 5.0-dev--snapshot--2018-07-25--master--077fdacc2 and cannot reproduce the bug anymore. |
It might be a font Unicode issue on older Windows Versions. It would be nice if someone of the Mac or Linux user can check that as well. |
@Siedlerchr In Linux, with Java 1.7u162 this works for me. If someone wonders how to quickly use the test-code that I provide here in IDEA:
It should look like this Although I don't see a vast difference between plain and bold text, at least I have no missing characters. |
Thanks for the test, but are you aware that it runs completely on JavaFX now (maintable and entry editor)? I think we can close this again, as windows 7 specific |
@Siedlerchr this "problem" might still exists in Mac OS X. I have managed to get some inconsistent behaviours on this one (sometimes italic and bold works as expected and sometimes not at all, and sometimes like on the screenshot, it partially works). Should I open up a new issue or is this better solved in some other way? Version of screenshot is red highlights are added by me |
For the author/editor field it's not that relevant, title or any other fields are more important |
I could look at it tomorrow, the behaviour is the same/similar in author/title and I can get it to both work/break, the only difference between the 2 screenshots are a resizing event. Also note that the preview in the bottom right doesn't display the same thing as the maintable. Even if this is just a Mac OS X "thing", does it seem reasonable that I take a closer look at it? |
@k3KAW8Pnf7mkmdSMPHz27 The entry preview is controlled over html code in the preferences under Entry preview. It's essentially a web browser component. (WebView) I guess there is something wrong with the latex2unicode parsing as well |
I'll not put more time into this then, I am off to find some more beginner friendly issue to tackle 😎 |
Feel free to take any open issue you want. |
Entry to reproduce:
Gives the following representation in the main table
The Preview is not affected.
The text was updated successfully, but these errors were encountered: