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

Title case option which also operates on uppercase words #16539

Closed
qgib opened this issue Apr 14, 2013 · 10 comments · Fixed by #38793
Closed

Title case option which also operates on uppercase words #16539

qgib opened this issue Apr 14, 2013 · 10 comments · Fixed by #38793
Labels
Feature Request Labeling Related to QGIS map labeling

Comments

@qgib
Copy link
Contributor

qgib commented Apr 14, 2013

Author Name: Nyall Dawson (@nyalldawson)
Original Redmine Issue: 7611

Redmine category:labelling


Setting a type case of "Title case" has no effect on the way labels are rendered when the text is already in upper case. For example, in the attached image "KNOX" is rendered as "KNOX", not "Knox". The other case settings (All uppercase/lowercase) work as expected.

EDIT
As discussed, "Title case" has been renamed "capitalize first letter", so this is now a feature request for a "Title case" feature, which would also lowercase subsequent letters.



Related issue(s): #16632 (relates), #17606 (relates), #20900 (duplicates)
Redmine related issue(s): 7724, 8938, 12804


@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2013

Author Name: Borys Jurgiel (@borysiasty)


I wouldn't expect the title() function will convert upper case characters to lower case. It would be a regression, as you couldn't create labels like "Quantum GIS Headquarters". In your case you can simply use: title(lower(lga_name))

I'm closing the ticket, but of course feel free to reopen if you disagree or I misunderstood something.


  • resolution was changed from to invalid

@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2013

Author Name: Borys Jurgiel (@borysiasty)


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2013

Author Name: Larry Shaffer (Larry Shaffer)


Hi Nyall,

The Title case used there in labeling is Qt's 'Capitalize' from "QFont enum Capitalization":http://qt-project.org/doc/qt-4.7/qfont.html#id-467833f3-6151-4157-a9f3-8dad38515ff7:

QFont::Capitalize 	4 	This alters the text to be rendered with the first character of each word as an uppercase character.

However, this differs from how page-layout programs and the 'title' function in the Expression editor work. Usually, setting "title case will convert uppercase letters to lowercase":http://grammar.about.com/od/tz/g/Title-Case.htm, as is done in the title function.

I propose to rename the Title function Nyall refers to as 'Capitalize' or 'Capitalize first letter' instead, so there is no confusion.


  • status_id was changed from Closed to Reopened
  • resolution was changed from invalid to

@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2013

Author Name: Nyall Dawson (@nyalldawson)


Borys - that makes sense, but as Larry pointed out it's a bit confusing for users. My vote would be to change the wording to "Capitalize first letter", since that makes it a bit clearer that it only applies to the first letter and not the rest of the letters.

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2013

Author Name: Nyall Dawson (@nyalldawson)


Borys - after thinking about this, I'm a little puzzled what the use case is for your example. Are you saying you have a value in your table with mixed but predominantly lower-case characters ("quantum GIS headquarters")? Wouldn't it be much more common to have either all lower-case or all upper-case values in a table? Or is this function designed more for converting sentences like "Located at quantum GIS headquarters."?

@qgib
Copy link
Contributor Author

qgib commented Apr 17, 2013

Author Name: Borys Jurgiel (@borysiasty)


Maybe my example was too abstract, better one would be POI names that are sometimes acronyms. I prefer to be forced to use the two functions capitalize(lower(lga_name)) over having no way to preserve acronyms. Of course the best would be to have both capitalize() and title().

But maybe it's not so important. Usually I have the luck to work on properly prepared data, so I don't have much experience with correcting poor data at this stage. I don't insist anymore :)

@qgib
Copy link
Contributor Author

qgib commented Apr 17, 2013

Author Name: Nyall Dawson (@nyalldawson)


Lucky -- Almost all the data I work with is poorly formatted! Anyway, I think the best resolution would be renaming Title case -> Capitalize First Letter for now, and then ideally adding a proper "Title case" option after 2.0. We could even make it handle fancy things like not capitalizing "a" or "the" when they're in the middle of a string...

@qgib
Copy link
Contributor Author

qgib commented Jun 28, 2014

Author Name: Jürgen Fischer (@jef-n)


  • fixed_version_id was changed from Version 2.0.0 to Future Release - Lower Priority

@qgib
Copy link
Contributor Author

qgib commented Jun 16, 2015

Author Name: Alister Hood (@AlisterH)


  • tracker_id was changed from 1 to 2
  • subject was changed from Title case has no effect to Title case option which also operates on uppercase words

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0

@qgib qgib added Feature Request Labeling Related to QGIS map labeling labels May 24, 2019
@qgib qgib added this to the Future Release - Lower Priority milestone May 24, 2019
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Sep 16, 2020
rename the confusing "Capitalize First Letter" option to
"Force First Letter to Capital"

This change is intended to clarify the role of the "capitalize
first letter" option, and to provide an option which actually
does what users expect the "capitalize first letter" option
to do.

Fixes qgis#16539
nyalldawson added a commit that referenced this issue Sep 16, 2020
rename the confusing "Capitalize First Letter" option to
"Force First Letter to Capital"

This change is intended to clarify the role of the "capitalize
first letter" option, and to provide an option which actually
does what users expect the "capitalize first letter" option
to do.

Fixes #16539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Labeling Related to QGIS map labeling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant