Summary: | user defined symbol table cannot include UTF8 characters | ||
---|---|---|---|
Product: | [Applications] kile | Reporter: | Yossi Gil <yossi.gil> |
Component: | general | Assignee: | Michel Ludwig <michel.ludwig> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | thomas.braun, yossi.gil |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | A sample file generated for the user symbols |
Description
Yossi Gil
2009-03-17 20:52:47 UTC
Hi, could you give an example what gets inserted instead? And can you attach one of the in this way generated pngs? thanks, thomas Well, what gets inserted is a simple "?", that is a single question mark. Created attachment 32229 [details]
A sample file generated for the user symbols
Okay, there are two things to mention here. The easy part is that the coded for the input stream in gesymb.cpp has to be set to e. g. UTF-8. The tricky part is [ taken from http://www.libpng.org/pub/png/spec/1.1/PNG-Chunks.html#C.tEXt]: Both keyword and text are interpreted according to the ISO/IEC 8859-1 (Latin-1) character set [ISO/IEC-8859-1]. The text string can contain any Latin-1 character. Newlines in the text string should be represented by a single linefeed character (decimal 10); use of other control characters in the text is discouraged. So we have to find a way to hack around this limitation. Here is what can be done. Each PNG file could have another key, pair value, in the form <UNICODE-ALTERNATE: U+03B1> If the pair is present, and the user enabled a newly introduced UNICODE mode, clicking on the icon, would insert the single Unicode alternative. This should apply to all symbols, not just user defined. I figured out that the changed should be in void SymbolView::fillWidget(const QString& prefix) ... to change the following line somehow: item->setKey( refCnts[i] + '%' + image.text("Command") + '%' + image.text("Packages") + '%' + paths[i] ; Is this correct? Why do you save the path here? Hi, I started looking into it. Using the integer number for the unicode symbol is a good idea. I'll also started to adapt gesymb. The code line in symbolView::fillWidget you cite is correct. The path is saved for the "most recently used" list of symbols. SVN commit 965595 by tbraun: new file format for generating png symbols and UTF-8 support The xml format is defined by the example file draft-version-symbolFormat.xml. These files can be read by gesymb-ng and create png files like gesymb. Some new things are possible with gesymb-ng: - UTF-8 characters instead of commands can be inserted. Especially useful for symbols like \neq. This can be set global in kile. - A list of packages which are needed for UTF-8 symbols are defined on a per file basis. This differs from latex commands where each can have different depending packages. This might change in the future if needed. - A comment string (UTF-8 encoded including HTML Markup) can be added to the png and this will be displayed as part of the tooltip. BUG: 187438 BUG: 175551 To try gesymb-ng do the following: - svn up - cd <kile-build-directory>/src/data/symbols-ng - make gesymb-ng - ./gesymb-ng <kile-src-path>/src/data/draft-version-symbolFormat.xml - mkdir ~/.kde/share/apps/kile/mathsymbols/user (maybe the path to your kde dot directory is .kde4) - cp img002math.png ~/.kde/share/apps/kile/mathsymbols/user - restart kile - Hover your mouse over this user defined symbol - Enjoy! WebSVN link: http://websvn.kde.org/?view=rev&revision=965595 |