Skip to content

Commit

Permalink
Improve text tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Dec 26, 2023
1 parent d8bc442 commit 6848f66
Show file tree
Hide file tree
Showing 14 changed files with 465 additions and 15 deletions.
28 changes: 14 additions & 14 deletions simulator/js/objs/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ fonts = [
'Lucida Sans'
];

fontStyles = [
'Normal',
'Bold',
'Italic',
'Bold Italic',
'Oblique',
'Bold Oblique'
]
fontStyles = {
'Normal': getMsg('normal'),
'Bold': getMsg('bold'),
'Italic': getMsg('italic'),
'Bold Italic': getMsg('bolditalic'),
'Oblique': getMsg('oblique'),
'Bold Oblique': getMsg('boldoblique')
}

fontAlignments = {
'left': "Left",
'center': "Centre",
'right': "Right"
'left': getMsg('left'),
'center': getMsg('center'),
'right': getMsg('right')
}

objTypes['text'] = {

//建立物件 Create the obj
create: function(mouse) {
return {type: 'text', x: mouse.x, y: mouse.y, p: 'text here', fontSize: 24, fontName: 'Serif', fontStyle: 'Normal', fontAlignment: 'left', fontSmallCaps: false, fontAngle: 0};
return {type: 'text', x: mouse.x, y: mouse.y, p: getMsg("text_here"), fontSize: 24, fontName: 'Serif', fontStyle: 'Normal', fontAlignment: 'left', fontSmallCaps: false, fontAngle: 0};
},

//顯示屬性方塊 Show the property box
Expand All @@ -50,7 +50,7 @@ objTypes['text'] = {
if (createAdvancedOptions(typeof obj.fontSize != 'undefined' && (obj.fontSize != 24 || obj.fontName != 'Serif' || obj.fontStyle != 'Normal' || obj.fontAlignment != 'left' || obj.fontSmallCaps || obj.fontAngle != 0))) {
createNumberAttr(getMsg('fontsize'), 6, 96, 1, obj.fontSize || 24, function(obj, value) {
obj.fontSize = value;
}, elem);
}, elem, null, true);
createDropdownAttr(getMsg('fontname'), obj.fontName || 'Serif', fonts, function(obj, value) {
obj.fontName = value;
}, elem);
Expand All @@ -65,7 +65,7 @@ objTypes['text'] = {
}, elem);
createNumberAttr(getMsg('angle'), 0, 360, 1, obj.fontAngle || 0, function(obj, value) {
obj.fontAngle = value;
}, elem);
}, elem, null, true);
}
},

Expand Down
2 changes: 1 addition & 1 deletion simulator/js/parameterBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function createTextAttr(label, value, func, elem) {
};
objAttr_text.onclick = function(e)
{
this.select();
//this.select();
};
}

Expand Down
40 changes: 40 additions & 0 deletions simulator/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,50 @@ locales["de"] = {
"incomplete": true,
"message": "Style"
},
"normal": {
"incomplete": true,
"message": "Normal"
},
"bold": {
"incomplete": true,
"message": "Bold"
},
"italic": {
"incomplete": true,
"message": "Italic"
},
"bolditalic": {
"incomplete": true,
"message": "Bold Italic"
},
"oblique": {
"incomplete": true,
"message": "Oblique"
},
"boldoblique": {
"incomplete": true,
"message": "Bold Oblique"
},
"fontalignment": {
"incomplete": true,
"message": "Alignment"
},
"left": {
"incomplete": true,
"message": "Left"
},
"center": {
"incomplete": true,
"message": "Centre"
},
"right": {
"incomplete": true,
"message": "Right"
},
"text_here": {
"incomplete": true,
"message": "Text Here"
},
"smallcaps": {
"incomplete": true,
"message": "Small Caps"
Expand Down
30 changes: 30 additions & 0 deletions simulator/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,39 @@ locales["en"] = {
"fontstyle": {
"message": "Style"
},
"normal": {
"message": "Normal"
},
"bold": {
"message": "Bold"
},
"italic": {
"message": "Italic"
},
"bolditalic": {
"message": "Bold Italic"
},
"oblique": {
"message": "Oblique"
},
"boldoblique": {
"message": "Bold Oblique"
},
"fontalignment": {
"message": "Alignment"
},
"left": {
"message": "Left"
},
"center": {
"message": "Centre"
},
"right": {
"message": "Right"
},
"text_here": {
"message": "Text Here"
},
"smallcaps": {
"message": "Small Caps"
},
Expand Down
40 changes: 40 additions & 0 deletions simulator/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,50 @@ locales["fr"] = {
"incomplete": true,
"message": "Style"
},
"normal": {
"incomplete": true,
"message": "Normal"
},
"bold": {
"incomplete": true,
"message": "Bold"
},
"italic": {
"incomplete": true,
"message": "Italic"
},
"bolditalic": {
"incomplete": true,
"message": "Bold Italic"
},
"oblique": {
"incomplete": true,
"message": "Oblique"
},
"boldoblique": {
"incomplete": true,
"message": "Bold Oblique"
},
"fontalignment": {
"incomplete": true,
"message": "Alignment"
},
"left": {
"incomplete": true,
"message": "Left"
},
"center": {
"incomplete": true,
"message": "Centre"
},
"right": {
"incomplete": true,
"message": "Right"
},
"text_here": {
"incomplete": true,
"message": "Text Here"
},
"smallcaps": {
"incomplete": true,
"message": "Small Caps"
Expand Down
40 changes: 40 additions & 0 deletions simulator/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,50 @@ locales["ja"] = {
"incomplete": false,
"message": "スタイル"
},
"normal": {
"incomplete": true,
"message": "Normal"
},
"bold": {
"incomplete": true,
"message": "Bold"
},
"italic": {
"incomplete": true,
"message": "Italic"
},
"bolditalic": {
"incomplete": true,
"message": "Bold Italic"
},
"oblique": {
"incomplete": true,
"message": "Oblique"
},
"boldoblique": {
"incomplete": true,
"message": "Bold Oblique"
},
"fontalignment": {
"incomplete": false,
"message": "文字揃え"
},
"left": {
"incomplete": true,
"message": "Left"
},
"center": {
"incomplete": true,
"message": "Centre"
},
"right": {
"incomplete": true,
"message": "Right"
},
"text_here": {
"incomplete": true,
"message": "Text Here"
},
"smallcaps": {
"incomplete": false,
"message": "スモールキャピタル"
Expand Down
40 changes: 40 additions & 0 deletions simulator/locales/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,50 @@ locales["ko"] = {
"incomplete": false,
"message": "스타일"
},
"normal": {
"incomplete": true,
"message": "Normal"
},
"bold": {
"incomplete": true,
"message": "Bold"
},
"italic": {
"incomplete": true,
"message": "Italic"
},
"bolditalic": {
"incomplete": true,
"message": "Bold Italic"
},
"oblique": {
"incomplete": true,
"message": "Oblique"
},
"boldoblique": {
"incomplete": true,
"message": "Bold Oblique"
},
"fontalignment": {
"incomplete": false,
"message": "정렬"
},
"left": {
"incomplete": true,
"message": "Left"
},
"center": {
"incomplete": true,
"message": "Centre"
},
"right": {
"incomplete": true,
"message": "Right"
},
"text_here": {
"incomplete": true,
"message": "Text Here"
},
"smallcaps": {
"incomplete": false,
"message": "Small Caps"
Expand Down
40 changes: 40 additions & 0 deletions simulator/locales/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,50 @@ locales["nl"] = {
"incomplete": true,
"message": "Style"
},
"normal": {
"incomplete": true,
"message": "Normal"
},
"bold": {
"incomplete": true,
"message": "Bold"
},
"italic": {
"incomplete": true,
"message": "Italic"
},
"bolditalic": {
"incomplete": true,
"message": "Bold Italic"
},
"oblique": {
"incomplete": true,
"message": "Oblique"
},
"boldoblique": {
"incomplete": true,
"message": "Bold Oblique"
},
"fontalignment": {
"incomplete": true,
"message": "Alignment"
},
"left": {
"incomplete": true,
"message": "Left"
},
"center": {
"incomplete": true,
"message": "Centre"
},
"right": {
"incomplete": true,
"message": "Right"
},
"text_here": {
"incomplete": true,
"message": "Text Here"
},
"smallcaps": {
"incomplete": true,
"message": "Small Caps"
Expand Down
Loading

0 comments on commit 6848f66

Please sign in to comment.