View Issue Details

IDProjectCategoryView StatusLast Update
0011988ScribusUser Interfacepublic2015-11-22 13:56
ReporterJLuc Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.5.0svn 
Target Version1.5.1Fixed in Version1.5.1svn 
Summary0011988: Preselected glyphs hint bubble should also display the unicode name of the glyph and the name of the font
DescriptionIn the favorite glyphs palette, there is a hint on each preselected glyph : it displays the Unicode code of the glyph.

It would help a lot to display also
- the name of the font.
- the unicode name of the glyph. For example 0x273F is also known as "BLACK FLORETTE"

Usefull also for totally blank glyphs (SOFT HYPHEN, NON BREAKING THIN SPACE, ...)

AMOF scribus allready knows all unicode names as can be seen in the table that opens when clicking on the "Magnifiying Glass" button of the favorite glyphs palette.

see also
http://www.unicode.org/ucd/#UCDinXML
http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
http://www.fileformat.info/info/unicode/char/273f/index.htm
https://github.com/fontforge/libuninameslist

Tagspatch
PatchYes

Relationships

related to 0011952 confirmed Character Palette UI enhancements 
related to 0012032 closed Glyph/Character Menu/Window naming inconsistency 
has duplicate 0011067 closed Insert glyph window 

Activities

ale

2014-08-29 13:25

manager   ~0033364

the request is good...

but i would not implement it as a tooltip.

one of both:

- show the information below each glyph (probably the best way to do it).
- add a separate area where you add the information about the current item.

Kunda

2014-08-29 19:21

updater   ~0033366

ale, if you could provide the structure template for how to add text below each glyph and a separate area to add the info for the current item...then it's just a question of compiling that info for each glyph. So most of legwork of this patch would be researching and data-entry for each glyph.

simonaw

2015-07-06 19:35

reporter   ~0035667

Added m_statusLabel for the glyph description

Kunda

2015-07-06 20:07

updater   ~0035668

Awesome! Will compile and test now

Kunda

2015-07-06 21:00

updater   ~0035671

Here is a screencast of the patch implemented:
https://www.dropbox.com/s/w9vxyswspmc0qxg/GlyphInsertPatch.m4v?dl=0

Kunda

2015-07-07 01:22

updater   ~0035673

SimonAW, perhaps we can also address 0012032 while you're tweeking this ?

Kunda

2015-07-07 01:24

updater   ~0035674

And 0011952

JLuc

2015-07-07 08:00

developer   ~0035680

That looks nice.
Could the text also introduce the glyph's font name ?

Kunda

2015-07-08 13:58

updater   ~0035687

Jluc, where should it introduce the fonts name ?

JLuc

2015-07-08 17:17

developer   ~0035695

Last edited: 2015-07-09 17:22

Kunda What is it you dont understand exactly ?

The prefered glyphs can be of various fonts.
As for now, it is not possible (in the glyphs palette) to know which is the font for a prefered glyph.
This is an issue when wanting to get to the same font so as to get another glyph of same font, or when wanting to be sure this is the exact wanted glyph.

With simonaw's patch, a long text below the box explains which is the glyph.
That's nice, but this very same area should also mention the name of the font.


I wish to rise another issue : I'm surprised that there is a long english sentence to describe the glyph. There are about 120737 defined unicode glyphs. Will scribus define 120,737 sentence to describe them all ?
And how will these long english explanations be translated ?
Is there a public repo with all explanations and translations ?

In case there is no satisfying answer to the previous questions, it would be way more simple and more robust to mention the plain name of the unicode glyph (instead of the long sentence describing it).

That unicode name does not need to be translated.

Kunda

2015-07-09 12:38

updater   ~0035709

120,737! holy smokes, that's an enormous amount.

simonaw

2015-07-09 19:17

reporter   ~0035718

@JLuc regarding the font name I can have a look.

Regarding the glyph description there is a text file "unicodenameslist.txt" in share/scribus describing /only/ 17'824. I don't know who is maintaining this file but maybe there is some official version that also comes in various translated languages?

simonaw

2015-07-09 21:07

reporter   ~0035721

New Patch, New Screenshot

simonaw

2015-07-09 21:30

reporter   ~0035723

V3

Kunda

2015-07-09 22:36

updater   ~0035724

Simon, compiles :)
Nice update :)
Found a bug:
https://www.dropbox.com/s/30q4n8aiimihm8s/charpallet-v3.m4v
that second char (apostrophe) won't insert to textbox when I double clicked on it.

cbradney

2015-07-09 23:09

administrator   ~0035727

Last edited: 2015-07-09 23:31

@SimonAW...

void CharSelect::slot_selectionChanged( const QItemSelection& sel, const QItemSelection& ) {
  QModelIndexList indexes = sel.indexes();
  if ( indexes.size() == 0 ) return;
  QModelIndex index = indexes.at(0);
  if ( !index.isValid() ) return;

  QVariant tmp = index.data(Qt::StatusTipRole);
  if ( !tmp.canConvert(QMetaType::QStringList) ) {
    m_statusLabel->setText(QString());
    return;
  }

  QStringList lst = tmp.toStringList();
  m_statusLabel->setText(
      QString("< p >< b >%1< /b >< /p >< p >Font: %2< /p>").arg(
        m_unicodeSearchModel->descriptionFromHex( lst.at(0) )
        ).arg(
          lst.at(1)
          )
    );
}

Scribus code style wants this to be like this:

void CharSelect::slot_selectionChanged(const QItemSelection& sel, const QItemSelection&)
{
    QModelIndexList indexes = sel.indexes();
    if (indexes.size() == 0)
        return;
    QModelIndex index = indexes.at(0);
    if (!index.isValid()) 
        return;

    QVariant tmp = index.data(Qt::StatusTipRole);
    if (!tmp.canConvert(QMetaType::QStringList))
    {
        m_statusLabel->setText(QString());
        return;
    }

    QStringList lst(tmp.toStringList());
    m_statusLabel->setText(QString("< p >< b >%1< /b >< /p >< p >Font: %2< /p >").arg(m_unicodeSearchModel->descriptionFromHex(lst.at(0))).arg(lst.at(1)));
}


Note extra spaces around < p > to avoid mantis reformatting.

{s on new lines
tabs are spaced at 4 chars
returns on new lines

FYI I have committed a fix to remove the deprecated QString::sprintf() in chartablemodel.cpp.

Kunda

2015-07-10 00:11

updater   ~0035729

Last edited: 2015-07-10 00:11

jluc,
7:01 PM	<Kunda> do you know anything about if this file is translated in to other languages
7:01 PM	<Kunda> ?
7:02 PM	<Kunda> this is the comment: http://bugs.scribus.net/view.php?id=11988#c35718
7:02 PM	<MrB> http://unicode.org/Public/UNIDATA/NamesList.txt
7:02 PM	<MrB> http://unicode.org/charts/charindex.html
7:03 PM	<mrscribe> Title: Character Name Index (at unicode.org)
7:05 PM	<MrB> I am not aware of any translations of this list.. apart from this US version I found here http://unicode.org/notes/tn24/ just now..
7:05 PM	<mrscribe> Title: UTN # 24: Sample American English Translation of Unicode Names List (at unicode.org)
7:05 PM	<Kunda> do these words need to be translated ?
7:05 PM	<Kunda> unicode character names
7:06 PM	<MrB> no idea.. we wouldnt add it to the translation files, no
7:06 PM	<Kunda> just shows all the words in english
7:06 PM	<Kunda> good
7:06 PM	<MrB> no idea if InDesign comes with a French version of the list or not
7:07 PM	<MrB> but no, we are not translating that stuff


simonaw

2015-07-10 11:22

reporter   ~0035733

@cbradney I didn't consider this patch final because I didn't expect coming this far. So this is why it was not styled according to the coding style guidelines. Sorry.

Kunda

2015-07-10 12:08

updater   ~0035737

simonaw, did you see the bug shown in the screencast? Can you recreate ?

cbradney

2015-07-10 16:25

administrator   ~0035740

@SimonAW.. that's ok... just saying

Kunda

2015-07-11 01:28

updater   ~0035754

Thanks to SimonAW, we figured out that what I encoutnered wasn't a bug so much. The problem pre-exists the patch. It was a 'combined' glyph that expects to be combined with another glyph. I think for now the patch that SimonAW proposes could be submitted for review and hopefully committed.

The Glyph/Char palette is low priority in regards to what is pending for the 1.5.1 release. Perhaps we can all get on the same page as to what the actual roadmap is.

cbradney

2015-07-11 16:30

administrator   ~0035758

Work has been done, lets get an updated patch and I'll commit it

JLuc

2015-07-13 09:06

developer   ~0035762

Last edited: 2015-07-14 22:42

In case these "long sentences" are the official unicode name, then they dont have to be translated. http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt seem to provide a (partial or complete) list. Strangely name for 00C6 is "LATIN CAPITAL LETTER AE", not "latin capitale letter ae (ash)" but i cant draw any conclusion of that apparent mismatch.


This patch is great and will improve usability of character palette !

JLuc

2015-07-14 22:42

developer   ~0035788

SimonAw : Craig B is ready to merge your patch. He waits now for your "final" patch, that is the rewriten patch according to scribus styles guidelines.

Thanks in advance !

simonaw

2015-07-15 07:46

reporter   ~0035790

@JLuc Sorry, was very busy lately. If you can wait I will submit the new patch in the evening. Thanks.

simonaw

2015-07-16 21:16

reporter  

0011988_glyph-description-status-label_v4.patch (5,535 bytes)   
diff --git a/scribus/chartablemodel.cpp b/scribus/chartablemodel.cpp
index e59d1ab..5c866c6 100644
--- a/scribus/chartablemodel.cpp
+++ b/scribus/chartablemodel.cpp
@@ -62,6 +62,15 @@ QVariant CharTableModel::data(const QModelIndex &index, int role) const
 		return "Unicode:\n0x"+tmp;
 	}
 
+	// status tip
+	if ( role == Qt::StatusTipRole )
+	{
+		QString tmp = QString("%1").arg(currentChar, 4, 16, QChar('0')).toUpper();
+		QStringList lst;
+		lst << tmp << currentFont;
+		return lst;
+	}
+
 	// pixmap
 	if (role == Qt::DecorationRole)
 	{
diff --git a/scribus/ui/charselect.cpp b/scribus/ui/charselect.cpp
index 49265a4..aeab896 100644
--- a/scribus/ui/charselect.cpp
+++ b/scribus/ui/charselect.cpp
@@ -39,12 +39,14 @@ CharSelect::CharSelect(QWidget* parent) : ScrPaletteBase(parent, "CharSelect"),
 	m_userTableModel = new CharTableModel(this, 6, m_doc, PrefsManager::instance()->appPrefs.itemToolPrefs.textFont);
 	loadUserContent(ScPaths::getApplicationDataDir() + "charpalette.ucp");
 
+	m_unicodeSearchModel = new UnicodeSearchModel(this);
+
 	m_userTable->setModel(m_userTableModel);
 	m_userTable->setAcceptDrops(true);
 
 	// signals and slots connections
 	connect(m_userTable, SIGNAL(selectChar(uint, QString)), this, SLOT(userNewChar(uint, QString)));
-	connect(m_userTableModel, SIGNAL(selectionChanged(QItemSelectionModel*)), m_userTable, SLOT(modelSelectionChanged(QItemSelectionModel*)));
+	connect(m_userTable->selectionModel(), SIGNAL(selectionChanged(const QItemSelection& ,const QItemSelection&)), this, SLOT(slot_selectionChanged(const QItemSelection&, const QItemSelection&)) );
 	connect(m_userTableModel, SIGNAL(rowAppended()), m_userTable, SLOT(resizeLastRow()));
 	connect(unicodeButton, SIGNAL(chosenUnicode(const QString &)), m_userTableModel, SLOT(appendUnicode(const QString &)));
 	connect(hideButton, SIGNAL(toggled(bool)), this, SLOT(hideButton_toggled(bool)));
@@ -156,6 +158,31 @@ void CharSelect::slot_insertUserSpecialChar(QChar ch, QString font)
 	m_doc->changed();
 }
 
+void CharSelect::slot_selectionChanged( const QItemSelection& sel, const QItemSelection& )
+{
+	QModelIndexList indexes = sel.indexes();
+	if ( indexes.size() == 0 )
+		return;
+
+	QModelIndex index = indexes.at(0);
+	if ( !index.isValid() )
+		return;
+
+	// we retrieve a QStringList of two elements from data() encapsulated in a
+	// QVariant, so we should make sure first that we can convert to QStringList.
+	// Otherwise clear the status label
+	QVariant tmp = index.data(Qt::StatusTipRole);
+	if ( !tmp.canConvert(QMetaType::QStringList) )
+	{
+		m_statusLabel->setText(QString());
+		return;
+	}
+
+	QStringList lst = tmp.toStringList();
+	m_statusLabel->setText("<p><b>" + QString("%1").arg(m_unicodeSearchModel->descriptionFromHex(lst.at(0))).toUpper() +
+												 "</b><br>" + QString(tr("Font: %2")).arg(lst.at(1)) + "</p>");
+}
+
 void CharSelect::openEnhanced()
 {
 	if (m_enhanced)
@@ -317,6 +344,7 @@ void CharSelect::uniClearButton_clicked()
 	   )
 	{
 		m_userTableModel->setCharacters(CharClassDef());
+		m_statusLabel->setText(QString());
 	}
 }
 
diff --git a/scribus/ui/charselect.h b/scribus/ui/charselect.h
index ace4ac8..15d3f56 100644
--- a/scribus/ui/charselect.h
+++ b/scribus/ui/charselect.h
@@ -10,6 +10,7 @@ for which a new license (GPL+exception) is in place.
 #include "scribusapi.h"
 #include "scrpalettebase.h"
 #include "chartablemodel.h"
+#include "unicodesearch.h"
 #include "ui_charselect.h"
 
 class PageItem;
@@ -64,6 +65,7 @@ private:
 	ScribusDoc* m_doc;
 	//! \brief m_userTable model
 	CharTableModel * m_userTableModel;
+	UnicodeSearchModel *m_unicodeSearchModel;
 
 	CharSelectEnhanced * m_enhanced;
 
@@ -86,6 +88,7 @@ private slots:
 	void slot_insertSpecialChar();
 	void slot_insertSpecialChars(const QString & chars);
 	void slot_insertUserSpecialChar(QChar, QString font);
+	void slot_selectionChanged( const QItemSelection&, const QItemSelection& );
 	void uniLoadButton_clicked();
 	void uniSaveButton_clicked();
 	void uniClearButton_clicked();
diff --git a/scribus/ui/charselect.ui b/scribus/ui/charselect.ui
index 55fe90e..1b0e3d7 100644
--- a/scribus/ui/charselect.ui
+++ b/scribus/ui/charselect.ui
@@ -81,6 +81,13 @@
      </property>
     </widget>
    </item>
+   <item row="2" column="0">
+    <widget class="QLabel" name="m_statusLabel">
+     <property name="text">
+      <string/>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
diff --git a/scribus/ui/unicodesearch.cpp b/scribus/ui/unicodesearch.cpp
index 22a2841..c7df3ad 100644
--- a/scribus/ui/unicodesearch.cpp
+++ b/scribus/ui/unicodesearch.cpp
@@ -117,6 +117,16 @@ UnicodeSearchModel::~UnicodeSearchModel()
 {
 }
 
+QString UnicodeSearchModel::descriptionFromHex(const QString& hex)
+{
+	foreach( UnicodeStruct I, m_unicode )
+	{
+		if ( I.hex == hex )
+			return I.description;
+	}
+	return QString();
+}
+
 int UnicodeSearchModel::rowCount(const QModelIndex & /*parent*/) const
 {
 	return m_unicode.count();
diff --git a/scribus/ui/unicodesearch.h b/scribus/ui/unicodesearch.h
index 53a9b8f..b5a374b 100644
--- a/scribus/ui/unicodesearch.h
+++ b/scribus/ui/unicodesearch.h
@@ -82,6 +82,9 @@ class UnicodeSearchModel : public QAbstractTableModel
 		//! \brief Return hex-key for the row of given index. See m_keys.
 		QString hexData(const QModelIndex & index);
 
+		//! \brief Return character unicode description from hex code
+		QString descriptionFromHex(const QString& hex);
+
 	private:
 
 		//! \brief Easier to use QPair-like replacement

simonaw

2015-07-16 21:26

reporter  

char_palette.png (12,053 bytes)   
char_palette.png (12,053 bytes)   

simonaw

2015-07-16 21:27

reporter   ~0035807

So. Sorry for the delay. Let's see what this patch brings...

I also added a status label clear on clearing the char palette.

Kunda

2015-07-16 23:22

updater   ~0035808

Thanks for all the work on this patch. Committed by Craig in r20254/5

christoph_s

2015-07-17 07:16

administrator   ~0035817

Tested, fixed for the time being. Once we have a complete list of Unicode names, someone please open a new report.

Issue History

Date Modified Username Field Change
2014-01-17 21:39 JLuc New Issue
2014-01-17 21:39 JLuc Tag Attached: easyhack
2014-07-04 19:10 JLuc Tag Detached: easyhack
2014-07-05 00:05 Kunda Target Version => 1.5.1
2014-07-05 00:05 Kunda Summary The preselected glyphs hint bubble should display the name of the font => The preselected glyphs hint bubble should display the UNICODE NAME of the glyph and the name of the font
2014-07-14 16:15 Kunda Relationship added related to 0011952
2014-08-29 13:25 ale Note Added: 0033364
2014-08-29 19:21 Kunda Note Added: 0033366
2014-08-29 19:39 Kunda Relationship added related to 0012032
2015-06-26 21:24 Kunda Relationship added has duplicate 0011067
2015-06-27 06:20 JLuc Patch => No
2015-06-27 06:20 JLuc Description Updated
2015-06-27 06:24 JLuc Description Updated
2015-06-27 06:25 JLuc Status new => confirmed
2015-07-05 19:35 JLuc Summary The preselected glyphs hint bubble should display the UNICODE NAME of the glyph and the name of the font => The preselected glyphs hint bubble should also display the unicode name of the glyph and the name of the font
2015-07-05 19:36 JLuc Description Updated
2015-07-06 19:34 simonaw File Added: char-palette-with-status.png
2015-07-06 19:34 simonaw File Added: 0011988_glyph-description-status-label.patch
2015-07-06 19:35 simonaw Tag Attached: patch
2015-07-06 19:35 simonaw Note Added: 0035667
2015-07-06 20:07 Kunda Note Added: 0035668
2015-07-06 21:00 Kunda Note Added: 0035671
2015-07-07 01:20 Kunda Patch No => Yes
2015-07-07 01:20 Kunda Summary The preselected glyphs hint bubble should also display the unicode name of the glyph and the name of the font => [Patch] Preselected glyphs hint bubble should also display the unicode name of the glyph and the name of the font
2015-07-07 01:22 Kunda Note Added: 0035673
2015-07-07 01:24 Kunda Note Added: 0035674
2015-07-07 08:00 JLuc Note Added: 0035680
2015-07-08 13:58 Kunda Note Added: 0035687
2015-07-08 17:17 JLuc Note Added: 0035695
2015-07-09 12:38 Kunda Note Added: 0035709
2015-07-09 17:22 JLuc Note Edited: 0035695
2015-07-09 19:17 simonaw Note Added: 0035718
2015-07-09 21:03 simonaw File Deleted: char-palette-with-status.png
2015-07-09 21:04 simonaw File Deleted: 0011988_glyph-description-status-label.patch
2015-07-09 21:04 simonaw File Added: 0011988_glyph-description-status-label_v2.patch
2015-07-09 21:07 simonaw File Added: char-palette-v2.png
2015-07-09 21:07 simonaw Note Added: 0035721
2015-07-09 21:30 simonaw File Deleted: 0011988_glyph-description-status-label_v2.patch
2015-07-09 21:30 simonaw File Added: 0011988_glyph-description-status-label_v3.patch
2015-07-09 21:30 simonaw Note Added: 0035723
2015-07-09 22:36 Kunda Note Added: 0035724
2015-07-09 23:09 cbradney Note Added: 0035727
2015-07-09 23:20 Kunda Note Edited: 0035727
2015-07-09 23:31 Kunda Note Edited: 0035727
2015-07-09 23:31 Kunda Note Edited: 0035727
2015-07-10 00:11 Kunda Note Added: 0035729
2015-07-10 00:11 Kunda Note Edited: 0035729
2015-07-10 11:22 simonaw Note Added: 0035733
2015-07-10 12:08 Kunda Note Added: 0035737
2015-07-10 16:25 cbradney Note Added: 0035740
2015-07-11 01:28 Kunda Note Added: 0035754
2015-07-11 16:30 cbradney Note Added: 0035758
2015-07-13 09:06 JLuc Note Added: 0035762
2015-07-14 22:20 JLuc Description Updated
2015-07-14 22:27 cbradney Assigned To => cbradney
2015-07-14 22:27 cbradney Status confirmed => assigned
2015-07-14 22:42 JLuc Note Added: 0035788
2015-07-14 22:42 JLuc Note Edited: 0035762
2015-07-15 07:46 simonaw Note Added: 0035790
2015-07-16 21:16 simonaw File Deleted: 0011988_glyph-description-status-label_v3.patch
2015-07-16 21:16 simonaw File Deleted: char-palette-v2.png
2015-07-16 21:16 simonaw File Added: 0011988_glyph-description-status-label_v4.patch
2015-07-16 21:26 simonaw File Added: char_palette.png
2015-07-16 21:27 simonaw Note Added: 0035807
2015-07-16 21:50 cbradney Status assigned => resolved
2015-07-16 21:50 cbradney Fixed in Version => 1.5.1svn
2015-07-16 21:50 cbradney Resolution open => fixed
2015-07-16 23:22 Kunda Note Added: 0035808
2015-07-17 07:16 christoph_s Note Added: 0035817
2015-07-17 07:16 christoph_s Status resolved => closed
2015-11-22 13:56 jghali Summary [Patch] Preselected glyphs hint bubble should also display the unicode name of the glyph and the name of the font => Preselected glyphs hint bubble should also display the unicode name of the glyph and the name of the font