Skip to content

Commit 930ca8d

Browse files
authored
Merge 839df28 into fb1ce94
2 parents fb1ce94 + 839df28 commit 930ca8d

14 files changed

Lines changed: 47 additions & 29 deletions

File tree

nvdaHelper/remote/displayModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void displayModelChunk_t::generateXML(wstring& text) {
4747
s<<L"baseline=\""<<baseline<<L"\" ";
4848
s<<L"direction=\""<<direction<<L"\" ";
4949
s<<L" font-name=\""<<formatInfo.fontName<<L"\" ";
50-
s<<L" font-size=\""<<formatInfo.fontSize<<L"pt\" ";
50+
s<<L" font-size=\""<<formatInfo.fontSize<<L"\" " ;
5151
if(this->formatInfo.bold) s<<L" bold=\"true\"";
5252
if(this->formatInfo.italic) s<<L" italic=\"true\"";
5353
if(this->formatInfo.underline) s<<L" underline=\"true\"";

nvdaHelper/remote/winword.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ void generateXMLAttribsForFormatting(IDispatch* pDispatchRange, int startOffset,
621621
}
622622
float fVal=0.0;
623623
if((formatConfig&formatConfig_reportFontSize)&&(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_SIZE,VT_R4,&fVal)==S_OK)) {
624-
formatAttribsStream<<L"font-size=\""<<fVal<<L"pt\" ";
624+
formatAttribsStream<<L"font-size=\""<<fVal<<L"\" ";
625625
}
626626
if((formatConfig&formatConfig_reportColor)&&(_com_dispatch_raw_propget(pDispatchFont,wdDISPID_FONT_COLOR,VT_I4,&iVal)==S_OK)) {
627627
formatAttribsStream<<L"color=\""<<iVal<<L"\" ";

nvdaHelper/vbufBackends/adobeAcrobat/adobeAcrobat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ VBufStorage_fieldNode_t* renderText(VBufStorage_buffer_t* buffer,
206206
if (fontSize > 0) {
207207
wostringstream s;
208208
s.setf(ios::fixed);
209-
s << setprecision(1) << fontSize << "pt";
209+
s << setprecision(1) << fontSize;
210210
previousNode->addAttribute(L"font-size", s.str());
211211
}
212212
if ((fontFlags&PDDOM_FONTATTR_ITALIC)==PDDOM_FONTATTR_ITALIC) previousNode->addAttribute(L"italic", L"1");

source/NVDAObjects/JAB/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ def _getFormatFieldAndOffsets(self, offset, formatConfig, calculateOffsets=True)
180180
attribs, length = self.obj.jabContext.getTextAttributesInRange(offset, self._endOffset - 1)
181181
field = textInfos.FormatField()
182182
field["font-family"] = attribs.fontFamily
183-
field["font-size"] = "%dpt" % attribs.fontSize
183+
# Translators: Abbreviation for points, a measurement of font size.
184+
field["font-size"] = _("%d pt") % attribs.fontSize
184185
field["bold"] = bool(attribs.bold)
185186
field["italic"] = bool(attribs.italic)
186187
field["strikethrough"] = bool(attribs.strikethrough)

source/NVDAObjects/UIA/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ def _getFormatFieldAtRange(self,textRange,formatConfig,ignoreMixedValues=False):
221221
formatField["font-name"]=val
222222
if formatConfig["reportFontSize"]:
223223
val=fetcher.getValue(UIAHandler.UIA_FontSizeAttributeId,ignoreMixedValues=ignoreMixedValues)
224-
if isinstance(val,numbers.Number):
225-
formatField['font-size']="%g pt"%float(val)
224+
if isinstance(val, numbers.Number):
225+
# Translators: Abbreviation for points, a measurement of font size.
226+
formatField['font-size'] = _("%g pt") % float(val)
226227
if formatConfig["reportFontAttributes"]:
227228
val=fetcher.getValue(UIAHandler.UIA_FontWeightAttributeId,ignoreMixedValues=ignoreMixedValues)
228229
if isinstance(val,int):

source/NVDAObjects/window/edit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
262262
if formatConfig["reportFontSize"]:
263263
if charFormat is None: charFormat=self._getCharFormat(offset)
264264
# Font size is supposed to be an integral value
265-
formatField["font-size"]="%spt"%(charFormat.yHeight//20)
265+
fontSize = charFormat.yHeight // 20
266+
# Translators: Abbreviation for points, a measurement of font size.
267+
formatField["font-size"] = _("%s pt") % fontSize
266268
if formatConfig["reportFontAttributes"]:
267269
if charFormat is None: charFormat=self._getCharFormat(offset)
268270
formatField["bold"]=bool(charFormat.dwEffects&CFE_BOLD)
@@ -507,7 +509,8 @@ def _getFormatFieldAtRange(self, textRange, formatConfig):
507509
if formatConfig["reportFontSize"]:
508510
if not fontObj:
509511
fontObj = textRange.font
510-
formatField["font-size"]="%spt"%fontObj.size
512+
# Translators: Abbreviation for points, a measurement of font size.
513+
formatField["font-size"] = _("%s pt") % fontObj.size
511514
if formatConfig["reportFontAttributes"]:
512515
if not fontObj:
513516
fontObj = textRange.font

source/NVDAObjects/window/excel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,8 @@ def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
994994
if formatConfig['reportFontName']:
995995
formatField['font-name']=fontObj.name
996996
if formatConfig['reportFontSize']:
997-
formatField['font-size']=str(fontObj.size)
997+
# Translators: Abbreviation for points, a measurement of font size.
998+
formatField['font-size']= _("%d pt") % int(fontObj.size)
998999
if formatConfig['reportFontAttributes']:
9991000
formatField['bold']=fontObj.bold
10001001
formatField['italic']=fontObj.italic

source/NVDAObjects/window/scintilla.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
127127
winKernel.virtualFreeEx(self.obj.processHandle,internalBuf,0,winKernel.MEM_RELEASE)
128128
formatField["font-name"]=fontNameBuf.value.decode("utf-8")
129129
if formatConfig["reportFontSize"]:
130-
formatField["font-size"]="%spt"%watchdog.cancellableSendMessage(self.obj.windowHandle,SCI_STYLEGETSIZE,style,0)
130+
fontSize = watchdog.cancellableSendMessage(self.obj.windowHandle, SCI_STYLEGETSIZE, style, 0)
131+
# Translators: Abbreviation for points, a measurement of font size.
132+
formatField["font-size"] = _("%s pt") % fontSize
131133
if formatConfig["reportLineNumber"]:
132134
formatField["line-number"]=self._getLineNumFromOffset(offset)+1
133135
if formatConfig["reportFontAttributes"]:

source/NVDAObjects/window/winword.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2006-2020 NV Access Limited, Manish Agrawal, Derek Riemer, Babbage B.V.
2+
# Copyright (C) 2006-2022 NV Access Limited, Manish Agrawal, Derek Riemer, Babbage B.V.
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

@@ -14,10 +14,6 @@
1414
from comtypes import COMError, GUID, BSTR
1515
import comtypes.client
1616
import comtypes.automation
17-
import uuid
18-
import operator
19-
import locale
20-
import collections
2117
import colorsys
2218
import eventHandler
2319
import braille
@@ -29,7 +25,6 @@
2925
from logHandler import log
3026
import winUser
3127
import oleacc
32-
import globalVars
3328
import speech
3429
import config
3530
import textInfos
@@ -900,6 +895,10 @@ def _normalizeFormatField(self,field,extraDetail=False):
900895
bullet=field.get('line-prefix')
901896
if bullet and len(bullet)==1:
902897
field['line-prefix']=mapPUAToUnicode.get(bullet,bullet)
898+
fontSize = field.get("font-size")
899+
if fontSize is not None:
900+
# Translators: Abbreviation for points, a measurement of font size.
901+
field["font-size"] = _("%s pt") % fontSize
903902
return field
904903

905904
def expand(self,unit):

source/appModules/powerpnt.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#appModules/powerpnt.py
2-
#A part of NonVisual Desktop Access (NVDA)
3-
#Copyright (C) 2012-2018 NV Access Limited
4-
#This file is covered by the GNU General Public License.
5-
#See the file COPYING for more details.
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2012-2022 NV Access Limited
3+
# This file is covered by the GNU General Public License.
4+
# See the file COPYING for more details.
5+
66
from typing import (
77
Optional,
88
Dict,
@@ -929,7 +929,8 @@ def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
929929
if formatConfig['reportFontName']:
930930
formatField['font-name']=font.name
931931
if formatConfig['reportFontSize']:
932-
formatField['font-size']=str(font.size)
932+
# Translators: Abbreviation for points, a measurement of font size.
933+
formatField['font-size']= _("%d pt") % int(font.size)
933934
if formatConfig['reportFontAttributes']:
934935
formatField['bold']=bool(font.bold)
935936
formatField['italic']=bool(font.italic)

0 commit comments

Comments
 (0)