summaryrefslogtreecommitdiffstats
path: root/src/widgets/text-toolbar.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-29 01:00:39 +0000
committerLiam P. White <inkscapebronyat-signgmaildotcom>2014-04-29 01:00:39 +0000
commiteca72e61451c8deae7f2f5fbaa9885aec946c790 (patch)
tree76d436abbbe469e0bc3b4a254e0ab6e5b4525e3b /src/widgets/text-toolbar.cpp
parentUpdate to trunk (diff)
parentwhen removing LPE, with 'flattening' option, don't recalculate/rewrite ellips... (diff)
downloadinkscape-eca72e61451c8deae7f2f5fbaa9885aec946c790.tar.gz
inkscape-eca72e61451c8deae7f2f5fbaa9885aec946c790.zip
Update to trunk and fix issues
(bzr r13090.1.67)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
-rw-r--r--src/widgets/text-toolbar.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 349fefa12..3a4f315da 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -72,20 +72,20 @@ using Inkscape::UI::PrefPusher;
static void sp_print_font( SPStyle *query ) {
- bool family_set = query->text->font_family.set;
+ bool family_set = query->font_family.set;
bool style_set = query->font_style.set;
- bool fontspec_set = query->text->font_specification.set;
+ bool fontspec_set = query->font_specification.set;
std::cout << " Family set? " << family_set
<< " Style set? " << style_set
<< " FontSpec set? " << fontspec_set
<< std::endl;
std::cout << " Family: "
- << (query->text->font_family.value ? query->text->font_family.value : "No value")
+ << (query->font_family.value ? query->font_family.value : "No value")
<< " Style: " << query->font_style.computed
<< " Weight: " << query->font_weight.computed
<< " FontSpec: "
- << (query->text->font_specification.value ? query->text->font_specification.value : "No value")
+ << (query->font_specification.value ? query->font_specification.value : "No value")
<< std::endl;
std::cout << " LineHeight: " << query->line_height.computed
<< " WordSpacing: " << query->word_spacing.computed
@@ -146,6 +146,13 @@ static void sp_text_fontfamily_value_changed( Ink_ComboBoxEntry_Action *act, GOb
std::cout << " New active: " << act->active << std::endl;
#endif
if( new_family.compare( fontlister->get_font_family() ) != 0 ) {
+ // Changed font-family
+
+ if( act->active == -1 ) {
+ // New font-family, not in document, not on system (could be fallback list)
+ fontlister->insert_font_family( new_family );
+ act->active = 0; // New family is always at top of list.
+ }
std::pair<Glib::ustring,Glib::ustring> ui = fontlister->set_font_family( act->active );
// active text set in sp_text_toolbox_selection_changed()
@@ -923,7 +930,6 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
}
// If we have valid query data for text (font-family, font-specification) set toolbar accordingly.
- if (query->text)
{
// Size (average of text selected)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -1051,11 +1057,11 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
ege_select_one_action_set_active( textOrientationAction, activeButton2 );
- } // if( query->text )
+ }
#ifdef DEBUG_TEXT
std::cout << " GUI: fontfamily.value: "
- << (query->text->font_family.value ? query->text->font_family.value : "No value")
+ << (query->font_family.value ? query->font_family.value : "No value")
<< std::endl;
std::cout << " GUI: font_size.computed: " << query->font_size.computed << std::endl;
std::cout << " GUI: font_weight.computed: " << query->font_weight.computed << std::endl;
@@ -1167,15 +1173,15 @@ static void sp_text_toolbox_select_cb( GtkEntry* entry, GtkEntryIconPosition /*p
SPItem *item = SP_ITEM(i->data);
SPStyle *style = item->style;
- if (style && style->text) {
+ if (style) {
Glib::ustring family_style;
- if (style->text->font_family.set) {
- family_style = style->text->font_family.value;
+ if (style->font_family.set) {
+ family_style = style->font_family.value;
//std::cout << " family style from font_family: " << family_style << std::endl;
}
- else if (style->text->font_specification.set) {
- family_style = style->text->font_specification.value;
+ else if (style->font_specification.set) {
+ family_style = style->font_specification.value;
//std::cout << " family style from font_spec: " << family_style << std::endl;
}