@jjlmoya/utils-tools 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/package.json +2 -1
  2. package/src/category/i18n/de.ts +172 -0
  3. package/src/category/i18n/id.ts +172 -0
  4. package/src/category/i18n/it.ts +172 -0
  5. package/src/category/i18n/ja.ts +172 -0
  6. package/src/category/i18n/ko.ts +172 -0
  7. package/src/category/i18n/nl.ts +172 -0
  8. package/src/category/i18n/pl.ts +172 -0
  9. package/src/category/i18n/pt.ts +172 -0
  10. package/src/category/i18n/ru.ts +172 -0
  11. package/src/category/i18n/sv.ts +172 -0
  12. package/src/category/i18n/tr.ts +172 -0
  13. package/src/category/i18n/zh.ts +172 -0
  14. package/src/category/index.ts +13 -1
  15. package/src/tests/i18n_coverage.test.ts +36 -0
  16. package/src/tests/locale_completeness.test.ts +1 -1
  17. package/src/tests/slug_language_code_format.test.ts +23 -0
  18. package/src/tests/slug_uniqueness.test.ts +81 -0
  19. package/src/tests/title_quality.test.ts +0 -1
  20. package/src/tool/date-diff-calculator/i18n/de.ts +132 -0
  21. package/src/tool/date-diff-calculator/i18n/fr.ts +1 -1
  22. package/src/tool/date-diff-calculator/i18n/id.ts +132 -0
  23. package/src/tool/date-diff-calculator/i18n/it.ts +132 -0
  24. package/src/tool/date-diff-calculator/i18n/ja.ts +132 -0
  25. package/src/tool/date-diff-calculator/i18n/ko.ts +132 -0
  26. package/src/tool/date-diff-calculator/i18n/nl.ts +132 -0
  27. package/src/tool/date-diff-calculator/i18n/pl.ts +132 -0
  28. package/src/tool/date-diff-calculator/i18n/pt.ts +132 -0
  29. package/src/tool/date-diff-calculator/i18n/ru.ts +132 -0
  30. package/src/tool/date-diff-calculator/i18n/sv.ts +132 -0
  31. package/src/tool/date-diff-calculator/i18n/tr.ts +132 -0
  32. package/src/tool/date-diff-calculator/i18n/zh.ts +132 -0
  33. package/src/tool/date-diff-calculator/index.ts +12 -0
  34. package/src/tool/drive-direct-link/i18n/de.ts +118 -0
  35. package/src/tool/drive-direct-link/i18n/id.ts +118 -0
  36. package/src/tool/drive-direct-link/i18n/it.ts +118 -0
  37. package/src/tool/drive-direct-link/i18n/ja.ts +118 -0
  38. package/src/tool/drive-direct-link/i18n/ko.ts +118 -0
  39. package/src/tool/drive-direct-link/i18n/nl.ts +118 -0
  40. package/src/tool/drive-direct-link/i18n/pl.ts +118 -0
  41. package/src/tool/drive-direct-link/i18n/pt.ts +118 -0
  42. package/src/tool/drive-direct-link/i18n/ru.ts +118 -0
  43. package/src/tool/drive-direct-link/i18n/sv.ts +118 -0
  44. package/src/tool/drive-direct-link/i18n/tr.ts +118 -0
  45. package/src/tool/drive-direct-link/i18n/zh.ts +118 -0
  46. package/src/tool/drive-direct-link/index.ts +12 -0
  47. package/src/tool/email-list-cleaner/i18n/de.ts +140 -0
  48. package/src/tool/email-list-cleaner/i18n/fr.ts +1 -1
  49. package/src/tool/email-list-cleaner/i18n/id.ts +140 -0
  50. package/src/tool/email-list-cleaner/i18n/it.ts +140 -0
  51. package/src/tool/email-list-cleaner/i18n/ja.ts +140 -0
  52. package/src/tool/email-list-cleaner/i18n/ko.ts +140 -0
  53. package/src/tool/email-list-cleaner/i18n/nl.ts +140 -0
  54. package/src/tool/email-list-cleaner/i18n/pl.ts +140 -0
  55. package/src/tool/email-list-cleaner/i18n/pt.ts +140 -0
  56. package/src/tool/email-list-cleaner/i18n/ru.ts +140 -0
  57. package/src/tool/email-list-cleaner/i18n/sv.ts +140 -0
  58. package/src/tool/email-list-cleaner/i18n/tr.ts +140 -0
  59. package/src/tool/email-list-cleaner/i18n/zh.ts +140 -0
  60. package/src/tool/email-list-cleaner/index.ts +12 -0
  61. package/src/tool/env-badge-spain/i18n/de.ts +153 -0
  62. package/src/tool/env-badge-spain/i18n/es.ts +1 -1
  63. package/src/tool/env-badge-spain/i18n/fr.ts +1 -1
  64. package/src/tool/env-badge-spain/i18n/id.ts +153 -0
  65. package/src/tool/env-badge-spain/i18n/it.ts +153 -0
  66. package/src/tool/env-badge-spain/i18n/ja.ts +153 -0
  67. package/src/tool/env-badge-spain/i18n/ko.ts +153 -0
  68. package/src/tool/env-badge-spain/i18n/nl.ts +153 -0
  69. package/src/tool/env-badge-spain/i18n/pl.ts +153 -0
  70. package/src/tool/env-badge-spain/i18n/pt.ts +153 -0
  71. package/src/tool/env-badge-spain/i18n/ru.ts +153 -0
  72. package/src/tool/env-badge-spain/i18n/sv.ts +153 -0
  73. package/src/tool/env-badge-spain/i18n/tr.ts +153 -0
  74. package/src/tool/env-badge-spain/i18n/zh.ts +153 -0
  75. package/src/tool/env-badge-spain/index.ts +12 -0
  76. package/src/tool/morse-beacon/i18n/de.ts +157 -0
  77. package/src/tool/morse-beacon/i18n/id.ts +157 -0
  78. package/src/tool/morse-beacon/i18n/it.ts +157 -0
  79. package/src/tool/morse-beacon/i18n/ja.ts +157 -0
  80. package/src/tool/morse-beacon/i18n/ko.ts +157 -0
  81. package/src/tool/morse-beacon/i18n/nl.ts +157 -0
  82. package/src/tool/morse-beacon/i18n/pl.ts +157 -0
  83. package/src/tool/morse-beacon/i18n/pt.ts +157 -0
  84. package/src/tool/morse-beacon/i18n/ru.ts +157 -0
  85. package/src/tool/morse-beacon/i18n/sv.ts +157 -0
  86. package/src/tool/morse-beacon/i18n/tr.ts +157 -0
  87. package/src/tool/morse-beacon/i18n/zh.ts +157 -0
  88. package/src/tool/morse-beacon/index.ts +13 -1
  89. package/src/tool/password-generator/i18n/de.ts +166 -0
  90. package/src/tool/password-generator/i18n/fr.ts +1 -1
  91. package/src/tool/password-generator/i18n/id.ts +166 -0
  92. package/src/tool/password-generator/i18n/it.ts +166 -0
  93. package/src/tool/password-generator/i18n/ja.ts +166 -0
  94. package/src/tool/password-generator/i18n/ko.ts +166 -0
  95. package/src/tool/password-generator/i18n/nl.ts +166 -0
  96. package/src/tool/password-generator/i18n/pl.ts +166 -0
  97. package/src/tool/password-generator/i18n/pt.ts +166 -0
  98. package/src/tool/password-generator/i18n/ru.ts +166 -0
  99. package/src/tool/password-generator/i18n/sv.ts +166 -0
  100. package/src/tool/password-generator/i18n/tr.ts +166 -0
  101. package/src/tool/password-generator/i18n/zh.ts +166 -0
  102. package/src/tool/password-generator/index.ts +13 -1
  103. package/src/tool/routes/i18n/de.ts +157 -0
  104. package/src/tool/routes/i18n/id.ts +157 -0
  105. package/src/tool/routes/i18n/it.ts +157 -0
  106. package/src/tool/routes/i18n/ja.ts +157 -0
  107. package/src/tool/routes/i18n/ko.ts +157 -0
  108. package/src/tool/routes/i18n/nl.ts +157 -0
  109. package/src/tool/routes/i18n/pl.ts +157 -0
  110. package/src/tool/routes/i18n/pt.ts +157 -0
  111. package/src/tool/routes/i18n/ru.ts +157 -0
  112. package/src/tool/routes/i18n/sv.ts +157 -0
  113. package/src/tool/routes/i18n/tr.ts +157 -0
  114. package/src/tool/routes/i18n/zh.ts +157 -0
  115. package/src/tool/routes/index.ts +13 -1
  116. package/src/tool/rule-of-three/i18n/de.ts +171 -0
  117. package/src/tool/rule-of-three/i18n/id.ts +171 -0
  118. package/src/tool/rule-of-three/i18n/it.ts +171 -0
  119. package/src/tool/rule-of-three/i18n/ja.ts +171 -0
  120. package/src/tool/rule-of-three/i18n/ko.ts +171 -0
  121. package/src/tool/rule-of-three/i18n/nl.ts +171 -0
  122. package/src/tool/rule-of-three/i18n/pl.ts +171 -0
  123. package/src/tool/rule-of-three/i18n/pt.ts +171 -0
  124. package/src/tool/rule-of-three/i18n/ru.ts +171 -0
  125. package/src/tool/rule-of-three/i18n/sv.ts +171 -0
  126. package/src/tool/rule-of-three/i18n/tr.ts +171 -0
  127. package/src/tool/rule-of-three/i18n/zh.ts +171 -0
  128. package/src/tool/rule-of-three/index.ts +13 -1
  129. package/src/tool/seo-content-optimizer/i18n/de.ts +136 -0
  130. package/src/tool/seo-content-optimizer/i18n/id.ts +136 -0
  131. package/src/tool/seo-content-optimizer/i18n/it.ts +136 -0
  132. package/src/tool/seo-content-optimizer/i18n/ja.ts +136 -0
  133. package/src/tool/seo-content-optimizer/i18n/ko.ts +136 -0
  134. package/src/tool/seo-content-optimizer/i18n/nl.ts +136 -0
  135. package/src/tool/seo-content-optimizer/i18n/pl.ts +136 -0
  136. package/src/tool/seo-content-optimizer/i18n/pt.ts +136 -0
  137. package/src/tool/seo-content-optimizer/i18n/ru.ts +136 -0
  138. package/src/tool/seo-content-optimizer/i18n/sv.ts +136 -0
  139. package/src/tool/seo-content-optimizer/i18n/tr.ts +136 -0
  140. package/src/tool/seo-content-optimizer/i18n/zh.ts +136 -0
  141. package/src/tool/seo-content-optimizer/index.ts +12 -0
  142. package/src/tool/speed-reader/i18n/de.ts +152 -0
  143. package/src/tool/speed-reader/i18n/id.ts +152 -0
  144. package/src/tool/speed-reader/i18n/it.ts +152 -0
  145. package/src/tool/speed-reader/i18n/ja.ts +152 -0
  146. package/src/tool/speed-reader/i18n/ko.ts +152 -0
  147. package/src/tool/speed-reader/i18n/nl.ts +152 -0
  148. package/src/tool/speed-reader/i18n/pl.ts +152 -0
  149. package/src/tool/speed-reader/i18n/pt.ts +152 -0
  150. package/src/tool/speed-reader/i18n/ru.ts +152 -0
  151. package/src/tool/speed-reader/i18n/sv.ts +152 -0
  152. package/src/tool/speed-reader/i18n/tr.ts +152 -0
  153. package/src/tool/speed-reader/i18n/zh.ts +152 -0
  154. package/src/tool/speed-reader/index.ts +12 -0
  155. package/src/tool/text-pixel-calculator/i18n/de.ts +133 -0
  156. package/src/tool/text-pixel-calculator/i18n/id.ts +133 -0
  157. package/src/tool/text-pixel-calculator/i18n/it.ts +133 -0
  158. package/src/tool/text-pixel-calculator/i18n/ja.ts +133 -0
  159. package/src/tool/text-pixel-calculator/i18n/ko.ts +133 -0
  160. package/src/tool/text-pixel-calculator/i18n/nl.ts +133 -0
  161. package/src/tool/text-pixel-calculator/i18n/pl.ts +133 -0
  162. package/src/tool/text-pixel-calculator/i18n/pt.ts +133 -0
  163. package/src/tool/text-pixel-calculator/i18n/ru.ts +133 -0
  164. package/src/tool/text-pixel-calculator/i18n/sv.ts +133 -0
  165. package/src/tool/text-pixel-calculator/i18n/tr.ts +133 -0
  166. package/src/tool/text-pixel-calculator/i18n/zh.ts +133 -0
  167. package/src/tool/text-pixel-calculator/index.ts +12 -0
  168. package/src/tool/whatsapp-link/i18n/de.ts +128 -0
  169. package/src/tool/whatsapp-link/i18n/id.ts +128 -0
  170. package/src/tool/whatsapp-link/i18n/it.ts +128 -0
  171. package/src/tool/whatsapp-link/i18n/ja.ts +128 -0
  172. package/src/tool/whatsapp-link/i18n/ko.ts +128 -0
  173. package/src/tool/whatsapp-link/i18n/nl.ts +128 -0
  174. package/src/tool/whatsapp-link/i18n/pl.ts +128 -0
  175. package/src/tool/whatsapp-link/i18n/pt.ts +128 -0
  176. package/src/tool/whatsapp-link/i18n/ru.ts +128 -0
  177. package/src/tool/whatsapp-link/i18n/sv.ts +128 -0
  178. package/src/tool/whatsapp-link/i18n/tr.ts +128 -0
  179. package/src/tool/whatsapp-link/i18n/zh.ts +128 -0
  180. package/src/tool/whatsapp-link/index.ts +12 -0
@@ -0,0 +1,133 @@
1
+ import type { ToolLocaleContent } from '../../../types';
2
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
3
+ import type { TextPixelCalculatorUI } from '../ui';
4
+
5
+ const faqData = [
6
+ {
7
+ question: 'Como calcular a largura em píxeis de um texto online?',
8
+ answer: 'Cole o seu texto na caixa de entrada, configure a fonte e o tamanho, e a ferramenta utilizará automaticamente a API Canvas do navegador para devolver a largura exata em píxeis.',
9
+ },
10
+ {
11
+ question: 'Por que a largura em píxeis varia entre diferentes fontes?',
12
+ answer: "A maioria das fontes são proporcionais, o que significa que cada caráter tem uma largura diferente. Por exemplo, um 'M' maiúsculo é sempre mais largo do que um 'i' minúsculo numa fonte sans-serif padrão.",
13
+ },
14
+ {
15
+ question: 'Medir carateres é o mesmo que medir píxeis?',
16
+ answer: 'Não. Medir carateres dá-lhe o comprimento da string, enquanto medir píxeis dá-lhe o espaço visual que ela ocupa. Isto é crucial para garantir que o texto não transborde do seu contentor num web design.',
17
+ },
18
+ {
19
+ question: 'Posso usar qualquer fonte do Google Fonts?',
20
+ answer: 'Sim, desde que a fonte esteja instalada no seu sistema operativo ou carregada na página atual, a ferramenta medirá as suas dimensões com precisão.',
21
+ },
22
+ {
23
+ question: 'É seguro processar textos privados ou trechos de código?',
24
+ answer: 'Sim. A calculadora funciona inteiramente de forma local. Nenhuns dados são enviados para servidores externos, garantindo total privacidade para os seus projetos.',
25
+ },
26
+ ];
27
+
28
+ const howToData = [
29
+ { name: 'Introduza o texto', text: 'Escreva ou cole o texto que deseja medir na área de entrada.' },
30
+ { name: 'Configure a fonte', text: 'Defina a família da fonte, o tamanho em píxeis, o peso e se é itálico.' },
31
+ { name: 'Leia o resultado', text: 'A largura em píxeis e a contagem de carateres são atualizadas em tempo real.' },
32
+ { name: 'Copie o valor', text: 'Clique em "Copiar largura" para guardar o número de píxeis na área de transferência.' },
33
+ ];
34
+
35
+ const faqSchema: WithContext<FAQPage> = {
36
+ '@context': 'https://schema.org',
37
+ '@type': 'FAQPage',
38
+ mainEntity: faqData.map((item) => ({
39
+ '@type': 'Question',
40
+ name: item.question,
41
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
42
+ })),
43
+ };
44
+
45
+ const howToSchema: WithContext<HowTo> = {
46
+ '@context': 'https://schema.org',
47
+ '@type': 'HowTo',
48
+ name: 'Como medir a largura do texto em píxeis',
49
+ step: howToData.map((s) => ({ '@type': 'HowToStep', name: s.name, text: s.text })),
50
+ };
51
+
52
+ const appSchema: WithContext<SoftwareApplication> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'SoftwareApplication',
55
+ name: 'Calculadora de Largura de Píxeis de Texto',
56
+ applicationCategory: 'UtilitiesApplication',
57
+ operatingSystem: 'Web',
58
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
59
+ description: 'Calcule com precisão a largura em píxeis de qualquer texto com base na fonte, tamanho e estilo.',
60
+ };
61
+
62
+ const ui: TextPixelCalculatorUI = {
63
+ textLabel: 'Texto a medir',
64
+ textPlaceholder: 'Escreva ou cole aqui o texto que deseja medir...',
65
+ defaultText: 'Olá Mundo',
66
+ fontLabel: 'Família da fonte',
67
+ sizeLabel: 'Tamanho (px)',
68
+ weightLabel: 'Peso',
69
+ italicLabel: 'Itálico',
70
+ widthLabel: 'Largura (píxeis)',
71
+ charsLabel: 'Carateres',
72
+ previewLabel: 'Pré-visualização visual',
73
+ copyBtn: 'Copiar largura',
74
+ resetBtn: 'Repor',
75
+ copyDone: 'Largura copiada',
76
+ };
77
+
78
+ export const content: ToolLocaleContent<TextPixelCalculatorUI> = {
79
+ slug: 'calculadora-largura-pixel-texto',
80
+ title: 'Calculadora de Largura de Píxeis de Texto',
81
+ description: 'Calcule com precisão a largura de qualquer texto em píxeis com base na fonte, tamanho e estilo. Ferramenta gratuita para designers e programadores.',
82
+ ui,
83
+ faqTitle: 'Perguntas Frequentes',
84
+ faq: faqData,
85
+ howTo: howToData,
86
+ bibliographyTitle: 'Referências',
87
+ bibliography: [
88
+ { name: 'W3C: CSS Text Module Level 3', url: 'https://www.w3.org/TR/css-text-3/' },
89
+ { name: 'Google Fonts: Understanding variable fonts', url: 'https://fonts.google.com/knowledge/glossary/variable_fonts' },
90
+ ],
91
+ schemas: [faqSchema, howToSchema, appSchema],
92
+ seo: [
93
+ { type: 'title', level: 2, text: 'Meça a largura exata em píxeis de qualquer texto' },
94
+ {
95
+ type: 'paragraph',
96
+ html: 'O seu texto está a transbordar do contentor? Precisa de saber quanto espaço um título ocupa antes de o renderizar? A <strong>API Canvas do navegador</strong> permite-lhe medir a largura exata de qualquer string de texto com precisão de píxeis, sem a renderizar no DOM.',
97
+ },
98
+ { type: 'title', level: 3, text: 'Por que a contagem de carateres não é suficiente' },
99
+ {
100
+ type: 'paragraph',
101
+ html: 'As fontes modernas são <strong>proporcionais</strong>: cada glifo tem uma largura diferente. Um "W" pode ocupar três vezes mais espaço do que um "i". O número de carateres não diz nada sobre o espaço visual real que o texto ocupa.',
102
+ },
103
+ {
104
+ type: 'list',
105
+ items: [
106
+ '<strong>Web design:</strong> Previna o transbordo em botões, etiquetas e células de tabela.',
107
+ '<strong>SEO:</strong> Os motores de busca truncam títulos por píxeis, não por carateres.',
108
+ '<strong>Canvas e PDF:</strong> Calcule a posição exata antes de desenhar o texto programaticamente.',
109
+ '<strong>Tooltips e balões:</strong> Dimensione dinamicamente os contentores com base no texto interior.',
110
+ ],
111
+ },
112
+ { type: 'title', level: 3, text: 'Como funciona a medição com Canvas' },
113
+ {
114
+ type: 'paragraph',
115
+ html: 'O método <code>ctx.measureText()</code> da API Canvas devolve um objeto <code>TextMetrics</code> com uma propriedade <code>width</code> que reflete a largura CSS em píxeis usando a fonte atualmente ativa. Esta ferramenta configura o contexto com a sua fonte, tamanho, peso e estilo antes de medir.',
116
+ },
117
+ {
118
+ type: 'code',
119
+ ariaLabel: 'Exemplo de Canvas measureText',
120
+ code: "const ctx = document.createElement('canvas').getContext('2d');\nctx.font = '700 16px Inter, system-ui, sans-serif';\nconst width = ctx.measureText('Olá Mundo').width; // ex: 74.5",
121
+ },
122
+ { type: 'title', level: 3, text: 'Privacidade e processamento local' },
123
+ {
124
+ type: 'paragraph',
125
+ html: 'Todo o cálculo acontece no seu navegador. Nenhuns textos, trechos de código ou dados privados saem do seu dispositivo.',
126
+ },
127
+ {
128
+ type: 'tip',
129
+ title: 'Fontes do Google Fonts',
130
+ html: 'Para medir uma fonte do Google Fonts com precisão, certifique-se primeiro de que ela está carregada na página ou instalada no seu sistema. Caso contrário, o navegador recorrerá a uma fonte substituta e o resultado será diferente.',
131
+ },
132
+ ],
133
+ };
@@ -0,0 +1,133 @@
1
+ import type { ToolLocaleContent } from '../../../types';
2
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
3
+ import type { TextPixelCalculatorUI } from '../ui';
4
+
5
+ const faqData = [
6
+ {
7
+ question: 'Как рассчитать ширину текста в пикселях онлайн?',
8
+ answer: 'Вставьте текст в поле ввода, настройте шрифт и размер, и инструмент автоматически использует Canvas API браузера, чтобы вернуть точную ширину в пикселях.',
9
+ },
10
+ {
11
+ question: 'Почему ширина в пикселях различается у разных шрифтов?',
12
+ answer: 'Большинство шрифтов являются пропорциональными, что означает, что каждый символ имеет разную ширину. Например, заглавная буква «M» всегда шире строчной «i» в стандартном шрифте без засечек.',
13
+ },
14
+ {
15
+ question: 'Равна ли длина в символах ширине в пикселях?',
16
+ answer: 'Нет. Количество символов дает вам длину строки, а измерение в пикселях — визуальное пространство, которое она занимает. Это крайне важно для предотвращения переполнения контейнера текстом в веб-дизайне.',
17
+ },
18
+ {
19
+ question: 'Могу ли я использовать любой шрифт Google Fonts?',
20
+ answer: 'Да, если шрифт установлен в вашей операционной системе или загружен на текущей странице, инструмент точно измерит его размеры.',
21
+ },
22
+ {
23
+ question: 'Безопасно ли обрабатывать личный текст или фрагменты кода?',
24
+ answer: 'Да. Калькулятор работает полностью локально. Данные не отправляются на внешние серверы, что гарантирует полную конфиденциальность ваших проектов.',
25
+ },
26
+ ];
27
+
28
+ const howToData = [
29
+ { name: 'Введите текст', text: 'Введите или вставьте текст, который вы хотите измерить, в поле ввода.' },
30
+ { name: 'Настройте шрифт', text: 'Укажите семейство шрифтов, размер в пикселях, насыщенность и начертание (курсив).' },
31
+ { name: 'Получите результат', text: 'Ширина в пикселях и количество символов обновляются в режиме реального времени.' },
32
+ { name: 'Скопируйте значение', text: 'Нажмите «Копировать ширину», чтобы сохранить количество пикселей в буфер обмена.' },
33
+ ];
34
+
35
+ const faqSchema: WithContext<FAQPage> = {
36
+ '@context': 'https://schema.org',
37
+ '@type': 'FAQPage',
38
+ mainEntity: faqData.map((item) => ({
39
+ '@type': 'Question',
40
+ name: item.question,
41
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
42
+ })),
43
+ };
44
+
45
+ const howToSchema: WithContext<HowTo> = {
46
+ '@context': 'https://schema.org',
47
+ '@type': 'HowTo',
48
+ name: 'Как измерить ширину текста в пикселях',
49
+ step: howToData.map((s) => ({ '@type': 'HowToStep', name: s.name, text: s.text })),
50
+ };
51
+
52
+ const appSchema: WithContext<SoftwareApplication> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'SoftwareApplication',
55
+ name: 'Калькулятор ширины текста в пикселях',
56
+ applicationCategory: 'UtilitiesApplication',
57
+ operatingSystem: 'Web',
58
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
59
+ description: 'Точно рассчитайте ширину любого текста в пикселях на основе шрифта, размера и стиля.',
60
+ };
61
+
62
+ const ui: TextPixelCalculatorUI = {
63
+ textLabel: 'Текст для измерения',
64
+ textPlaceholder: 'Введите или вставьте здесь текст, который хотите измерить...',
65
+ defaultText: 'Привет, мир',
66
+ fontLabel: 'Семейство шрифтов',
67
+ sizeLabel: 'Размер (px)',
68
+ weightLabel: 'Насыщенность',
69
+ italicLabel: 'Курсив',
70
+ widthLabel: 'Ширина (пиксели)',
71
+ charsLabel: 'Символы',
72
+ previewLabel: 'Визуальный просмотр',
73
+ copyBtn: 'Копировать ширину',
74
+ resetBtn: 'Сброс',
75
+ copyDone: 'Ширина скопирована',
76
+ };
77
+
78
+ export const content: ToolLocaleContent<TextPixelCalculatorUI> = {
79
+ slug: 'kalkulyator-shiriny-pikseley-teksta',
80
+ title: 'Калькулятор ширины текста в пикселях',
81
+ description: 'Точно рассчитайте ширину любого текста в пикселях на основе шрифта, размера и стиля. Бесплатный инструмент для дизайнеров и разработчиков.',
82
+ ui,
83
+ faqTitle: 'Часто задаваемые вопросы',
84
+ faq: faqData,
85
+ howTo: howToData,
86
+ bibliographyTitle: 'Источники',
87
+ bibliography: [
88
+ { name: 'W3C: CSS Text Module Level 3', url: 'https://www.w3.org/TR/css-text-3/' },
89
+ { name: 'Google Fonts: Understanding variable fonts', url: 'https://fonts.google.com/knowledge/glossary/variable_fonts' },
90
+ ],
91
+ schemas: [faqSchema, howToSchema, appSchema],
92
+ seo: [
93
+ { type: 'title', level: 2, text: 'Измерьте точную ширину любого текста в пикселях' },
94
+ {
95
+ type: 'paragraph',
96
+ html: 'Ваш текст выходит за пределы контейнера? Нужно узнать, сколько места занимает заголовок перед рендерингом? <strong>Canvas API браузера</strong> позволяет измерить точную ширину любой текстовой строки с пиксельной точностью без ее отрисовки в DOM.',
97
+ },
98
+ { type: 'title', level: 3, text: 'Почему подсчета символов недостаточно' },
99
+ {
100
+ type: 'paragraph',
101
+ html: 'Современные шрифты являются <strong>пропорциональными</strong>: каждый глиф имеет разную ширину. Буква «W» может занимать в три раза больше места, чем «i». Количество символов ничего не говорит вам о фактическом визуальном пространстве, которое занимает текст.',
102
+ },
103
+ {
104
+ type: 'list',
105
+ items: [
106
+ '<strong>Веб-дизайн:</strong> предотвращайте переполнение в кнопках, метках и ячейках таблиц.',
107
+ '<strong>SEO:</strong> поисковые системы обрезают заголовки по пикселям, а не по символам.',
108
+ '<strong>Canvas и PDF:</strong> рассчитывайте точное положение перед программной отрисовкой текста.',
109
+ '<strong>Подсказки и баблы:</strong> динамически устанавливайте размер контейнеров на основе текста внутри.',
110
+ ],
111
+ },
112
+ { type: 'title', level: 3, text: 'Как работает измерение с помощью Canvas' },
113
+ {
114
+ type: 'paragraph',
115
+ html: 'Метод <code>ctx.measureText()</code> интерфейса Canvas API возвращает объект <code>TextMetrics</code> со свойством <code>width</code>, отражающим ширину в CSS-пикселях с использованием текущего активного шрифта. Этот инструмент настраивает контекст с вашим шрифтом, размером, насыщенностью и стилем перед измерением.',
116
+ },
117
+ {
118
+ type: 'code',
119
+ ariaLabel: 'Пример использования Canvas measureText',
120
+ code: "const ctx = document.createElement('canvas').getContext('2d');\nctx.font = '700 16px Inter, system-ui, sans-serif';\nconst width = ctx.measureText('Привет, мир').width; // например, 74.5",
121
+ },
122
+ { type: 'title', level: 3, text: 'Конфиденциальность и локальная обработка' },
123
+ {
124
+ type: 'paragraph',
125
+ html: 'Все вычисления происходят в вашем браузере. Никакой текст, фрагмент кода или личные данные не покидают ваше устройство.',
126
+ },
127
+ {
128
+ type: 'tip',
129
+ title: 'Шрифты Google Fonts',
130
+ html: 'Чтобы точно измерить шрифт Google Fonts, сначала убедитесь, что он загружен на страницу или установлен в вашей системе. В противном случае браузер вернется к подменному шрифту, и результат будет отличаться.',
131
+ },
132
+ ],
133
+ };
@@ -0,0 +1,133 @@
1
+ import type { ToolLocaleContent } from '../../../types';
2
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
3
+ import type { TextPixelCalculatorUI } from '../ui';
4
+
5
+ const faqData = [
6
+ {
7
+ question: 'Hur beräknar jag pixelbredden för text online?',
8
+ answer: 'Klistra in din text i inmatningsrutan, konfigurera typsnitt och storlek, så använder verktyget automatiskt webbläsarens Canvas API för att returnera den exakta bredden i pixlar.',
9
+ },
10
+ {
11
+ question: 'Varför varierar pixelbredden mellan olika typsnitt?',
12
+ answer: "De flesta typsnitt är proportionella, vilket innebär att varje tecken har en annan bredd. Till exempel är ett versalt 'M' alltid bredare än ett gement 'i' i ett vanligt sans-serif-typsnitt.",
13
+ },
14
+ {
15
+ question: 'Är mätning av tecken detsamma som mätning av pixlar?',
16
+ answer: 'Nej. Mätning av tecken ger dig stränglängden, medan mätning av pixlar ger dig det visuella utrymmet den upptar. Detta är avgörande för att säkerställa att texten inte flödar över sin behållare i en webbdesign.',
17
+ },
18
+ {
19
+ question: 'Kan jag använda vilket Google Fonts-typsnitt som helst?',
20
+ answer: 'Ja, så länge typsnittet är installerat på ditt operativsystem eller laddat på den aktuella sidan, kommer verktyget att mäta dess dimensioner korrekt.',
21
+ },
22
+ {
23
+ question: 'Är det säkert att bearbeta privat text eller kodsnuttar?',
24
+ answer: 'Ja. Kalkylatorn fungerar helt lokalt. Inga data skickas till externa servrar, vilket garanterar fullständig integritet för dina projekt.',
25
+ },
26
+ ];
27
+
28
+ const howToData = [
29
+ { name: 'Ange texten', text: 'Skriv eller klistra in texten du vill mäta i inmatningsområdet.' },
30
+ { name: 'Konfigurera typsnittet', text: 'Ställ in typsnittsfamilj, storlek i pixlar, vikt och om den ska vara kursiv.' },
31
+ { name: 'Läs av resultatet', text: 'Pixelbredden och teckenantalet uppdateras i realtid.' },
32
+ { name: 'Kopiera värdet', text: 'Klicka på "Kopiera bredd" för att spara pixelantalet till klippbordet.' },
33
+ ];
34
+
35
+ const faqSchema: WithContext<FAQPage> = {
36
+ '@context': 'https://schema.org',
37
+ '@type': 'FAQPage',
38
+ mainEntity: faqData.map((item) => ({
39
+ '@type': 'Question',
40
+ name: item.question,
41
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
42
+ })),
43
+ };
44
+
45
+ const howToSchema: WithContext<HowTo> = {
46
+ '@context': 'https://schema.org',
47
+ '@type': 'HowTo',
48
+ name: 'Hur man mäter textbredd i pixlar',
49
+ step: howToData.map((s) => ({ '@type': 'HowToStep', name: s.name, text: s.text })),
50
+ };
51
+
52
+ const appSchema: WithContext<SoftwareApplication> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'SoftwareApplication',
55
+ name: 'Textpixelbreddskalkylator',
56
+ applicationCategory: 'UtilitiesApplication',
57
+ operatingSystem: 'Web',
58
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
59
+ description: 'Beräkna pixelbredden för valfri text korrekt baserat på typsnitt, storlek och stil.',
60
+ };
61
+
62
+ const ui: TextPixelCalculatorUI = {
63
+ textLabel: 'Text att mäta',
64
+ textPlaceholder: 'Skriv eller klistra in texten du vill mäta här...',
65
+ defaultText: 'Hej världen',
66
+ fontLabel: 'Typsnittsfamilj',
67
+ sizeLabel: 'Storlek (px)',
68
+ weightLabel: 'Vikt',
69
+ italicLabel: 'Kursiv',
70
+ widthLabel: 'Bredd (pixlar)',
71
+ charsLabel: 'Tecken',
72
+ previewLabel: 'Visuell förhandsgranskning',
73
+ copyBtn: 'Kopiera bredd',
74
+ resetBtn: 'Återställ',
75
+ copyDone: 'Bredd kopierad',
76
+ };
77
+
78
+ export const content: ToolLocaleContent<TextPixelCalculatorUI> = {
79
+ slug: 'text-pixel-beraknare',
80
+ title: 'Text Pixel Beräknare',
81
+ description: 'Beräkna exakt hur bred en text är i pixlar baserat på typsnitt, storlek och stil. Gratis verktyg för designers och utvecklare.',
82
+ ui,
83
+ faqTitle: 'Vanliga frågor',
84
+ faq: faqData,
85
+ howTo: howToData,
86
+ bibliographyTitle: 'Referenser',
87
+ bibliography: [
88
+ { name: 'W3C: CSS Text Module Level 3', url: 'https://www.w3.org/TR/css-text-3/' },
89
+ { name: 'Google Fonts: Understanding variable fonts', url: 'https://fonts.google.com/knowledge/glossary/variable_fonts' },
90
+ ],
91
+ schemas: [faqSchema, howToSchema, appSchema],
92
+ seo: [
93
+ { type: 'title', level: 2, text: 'Mät den exakta pixelbredden för valfri text' },
94
+ {
95
+ type: 'paragraph',
96
+ html: 'Flödar din text över sin behållare? Behöver du veta hur mycket utrymme en rubrik tar upp innan den renderas? Webbläsarens <strong>Canvas API</strong> låter dig mäta den exakta bredden på valfri textsträng med pixelprecision, utan att rendera den i DOM.',
97
+ },
98
+ { type: 'title', level: 3, text: 'Varför teckenräkning inte räcker' },
99
+ {
100
+ type: 'paragraph',
101
+ html: 'Moderna typsnitt är <strong>proportionella</strong>: varje glyf har en annan bredd. Ett "W" kan ta upp tre gånger mer utrymme än ett "i". Antalet tecken säger ingenting om det faktiska visuella utrymmet texten upptar.',
102
+ },
103
+ {
104
+ type: 'list',
105
+ items: [
106
+ '<strong>Webbdesign:</strong> Förhindra spill i knappar, etiketter och tabellceller.',
107
+ '<strong>SEO:</strong> Sökmotorer trunkerar titlar efter pixlar, inte efter tecken.',
108
+ '<strong>Canvas och PDF:</strong> Beräkna den exakta positionen innan du ritar text programmatiskt.',
109
+ '<strong>Tooltips och bubblor:</strong> Storleksanpassa behållare dynamiskt baserat på den inre texten.',
110
+ ],
111
+ },
112
+ { type: 'title', level: 3, text: 'Hur mätning fungerar med Canvas' },
113
+ {
114
+ type: 'paragraph',
115
+ html: 'Metoden <code>ctx.measureText()</code> i Canvas API returnerar ett <code>TextMetrics</code>-objekt med en <code>width</code>-egenskap som speglar CSS-pixelbredden med det för närvarande aktiva typsnittet. Detta verktyg konfigurerar kontexten med ditt typsnitt, storlek, vikt och stil före mätning.',
116
+ },
117
+ {
118
+ type: 'code',
119
+ ariaLabel: 'Exempel på Canvas measureText',
120
+ code: "const ctx = document.createElement('canvas').getContext('2d');\nctx.font = '700 16px Inter, system-ui, sans-serif';\nconst width = ctx.measureText('Hej världen').width; // t.ex. 74.5",
121
+ },
122
+ { type: 'title', level: 3, text: 'Integritet och lokal bearbetning' },
123
+ {
124
+ type: 'paragraph',
125
+ html: 'All beräkning sker i din webbläsare. Ingen text, kodsnutt eller privat data lämnar din enhet.',
126
+ },
127
+ {
128
+ type: 'tip',
129
+ title: 'Google Fonts typsnitt',
130
+ html: 'För att mäta ett Google Fonts-typsnitt korrekt, se först till att det är laddat på sidan eller installerat på ditt system. Annars kommer webbläsaren att falla tillbaka på ett ersättningstypsnitt och resultatet kommer att skilja sig.',
131
+ },
132
+ ],
133
+ };
@@ -0,0 +1,133 @@
1
+ import type { ToolLocaleContent } from '../../../types';
2
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
3
+ import type { TextPixelCalculatorUI } from '../ui';
4
+
5
+ const faqData = [
6
+ {
7
+ question: 'Metnin piksel genişliğini çevrimiçi olarak nasıl hesaplarım?',
8
+ answer: 'Metninizi giriş kutusuna yapıştırın, yazı tipini ve boyutunu yapılandırın; araç, tam piksel genişliğini döndürmek için otomatik olarak tarayıcı Canvas API\'sini kullanacaktır.',
9
+ },
10
+ {
11
+ question: 'Piksel genişliği neden yazı tipleri arasında değişir?',
12
+ answer: "Çoğu yazı tipi orantılıdır, yani her karakterin farklı bir genişliği vardır. Örneğin, standart bir sans-serif yazı tipinde büyük 'M' harfi her zaman küçük 'i' harfinden daha geniştir.",
13
+ },
14
+ {
15
+ question: 'Karakter ölçmekle piksel ölçmek aynı şey midir?',
16
+ answer: 'Hayır. Karakter ölçmek size dizge uzunluğunu verirken, piksel ölçmek kapladığı görsel alanı verir. Bu, bir web tasarımında metnin kapsayıcısından taşmamasını sağlamak için çok önemlidir.',
17
+ },
18
+ {
19
+ question: 'Herhangi bir Google Fonts yazı tipini kullanabilir miyim?',
20
+ answer: 'Evet, yazı tipi işletim sisteminizde yüklü olduğu veya mevcut sayfada yüklendiği sürece araç boyutlarını doğru bir şekilde ölçecektir.',
21
+ },
22
+ {
23
+ question: 'Özel metinleri veya kod parçacıklarını işlemek güvenli midir?',
24
+ answer: 'Evet. Hesaplayıcı tamamen yerel olarak çalışır. Harici sunuculara hiçbir veri gönderilmez, projeleriniz için tam gizlilik garanti edilir.',
25
+ },
26
+ ];
27
+
28
+ const howToData = [
29
+ { name: 'Metni girin', text: 'Ölçmek istediğiniz metni giriş alanına yazın veya yapıştırın.' },
30
+ { name: 'Yazı tipini yapılandırın', text: 'Yazı tipi ailesini, piksel cinsinden boyutunu, ağırlığını ve italik olup olmadığını ayarlayın.' },
31
+ { name: 'Sonucu okuyun', text: 'Piksel genişliği ve karakter sayısı gerçek zamanlı olarak güncellenir.' },
32
+ { name: 'Değeri kopyalayın', text: 'Piksel sayısını panoya kaydetmek için "Genişliği Kopyala"ya tıklayın.' },
33
+ ];
34
+
35
+ const faqSchema: WithContext<FAQPage> = {
36
+ '@context': 'https://schema.org',
37
+ '@type': 'FAQPage',
38
+ mainEntity: faqData.map((item) => ({
39
+ '@type': 'Question',
40
+ name: item.question,
41
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
42
+ })),
43
+ };
44
+
45
+ const howToSchema: WithContext<HowTo> = {
46
+ '@context': 'https://schema.org',
47
+ '@type': 'HowTo',
48
+ name: 'Metin genişliği piksel cinsinden nasıl ölçülür?',
49
+ step: howToData.map((s) => ({ '@type': 'HowToStep', name: s.name, text: s.text })),
50
+ };
51
+
52
+ const appSchema: WithContext<SoftwareApplication> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'SoftwareApplication',
55
+ name: 'Metin Piksel Genişliği Hesaplayıcı',
56
+ applicationCategory: 'UtilitiesApplication',
57
+ operatingSystem: 'Web',
58
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
59
+ description: 'Herhangi bir metnin yazı tipine, boyutuna ve stiline göre piksel genişliğini doğru bir şekilde hesaplayın.',
60
+ };
61
+
62
+ const ui: TextPixelCalculatorUI = {
63
+ textLabel: 'Ölçülecek metin',
64
+ textPlaceholder: 'Ölçmek istediğiniz metni buraya yazın veya yapıştırın...',
65
+ defaultText: 'Merhaba Dünya',
66
+ fontLabel: 'Yazı tipi ailesi',
67
+ sizeLabel: 'Boyut (px)',
68
+ weightLabel: 'Ağırlık',
69
+ italicLabel: 'İtalik',
70
+ widthLabel: 'Genişlik (piksel)',
71
+ charsLabel: 'Karakter',
72
+ previewLabel: 'Görsel önizleme',
73
+ copyBtn: 'Genişliği Kopyala',
74
+ resetBtn: 'Sıfırla',
75
+ copyDone: 'Genişlik kopyalandı',
76
+ };
77
+
78
+ export const content: ToolLocaleContent<TextPixelCalculatorUI> = {
79
+ slug: 'metin-piksel-genisligi-hesaplayici',
80
+ title: 'Metin Piksel Genişliği Hesaplayıcı',
81
+ description: 'Yazı tipi, boyut ve stile göre herhangi bir metnin kaç piksel genişliğinde olduğunu doğru bir şekilde hesaplayın. Tasarımcılar ve geliştiriciler için ücretsiz araç.',
82
+ ui,
83
+ faqTitle: 'Sıkça Sorulan Sorular',
84
+ faq: faqData,
85
+ howTo: howToData,
86
+ bibliographyTitle: 'Kaynaklar',
87
+ bibliography: [
88
+ { name: 'W3C: CSS Text Module Level 3', url: 'https://www.w3.org/TR/css-text-3/' },
89
+ { name: 'Google Fonts: Understanding variable fonts', url: 'https://fonts.google.com/knowledge/glossary/variable_fonts' },
90
+ ],
91
+ schemas: [faqSchema, howToSchema, appSchema],
92
+ seo: [
93
+ { type: 'title', level: 2, text: 'Herhangi bir metnin tam piksel genişliğini ölçün' },
94
+ {
95
+ type: 'paragraph',
96
+ html: 'Metniniz kapsayıcısından taşıyor mu? Bir başlığı oluşturmadan önce ne kadar yer kapladığını bilmeniz mi gerekiyor? <strong>Tarayıcı Canvas API\'si</strong>, herhangi bir metin dizisinin tam genişliğini DOM\'da oluşturmadan piksel hassasiyetiyle ölçmenize olanak tanır.',
97
+ },
98
+ { type: 'title', level: 3, text: 'Neden karakter sayımı yeterli değildir?' },
99
+ {
100
+ type: 'paragraph',
101
+ html: 'Modern yazı tipleri <strong>orantılıdır</strong>: her glifin farklı bir genişliği vardır. Bir "W", bir "i"den üç kat daha fazla yer kaplayabilir. Karakter sayısı size metnin kapladığı gerçek görsel alan hakkında hiçbir şey söylemez.',
102
+ },
103
+ {
104
+ type: 'list',
105
+ items: [
106
+ '<strong>Web tasarımı:</strong> Düğmelerde, etiketlerde ve tablo hücrelerinde taşmayı önleyin.',
107
+ '<strong>SEO:</strong> Arama motorları başlıkları karakter sayısına göre değil, piksellere göre kısaltır.',
108
+ '<strong>Canvas ve PDF:</strong> Programlı olarak metin çizmeden önce tam konumu hesaplayın.',
109
+ '<strong>Tooltip\'ler ve balonlar:</strong> Kapsayıcıları iç metne göre dinamik olarak boyutlandırın.',
110
+ ],
111
+ },
112
+ { type: 'title', level: 3, text: 'Canvas ile ölçüm nasıl çalışır?' },
113
+ {
114
+ type: 'paragraph',
115
+ html: 'Canvas API\'sinin <code>ctx.measureText()</code> yöntemi, o anda aktif olan yazı tipini kullanarak CSS piksel genişliğini yansıtan bir <code>width</code> özelliğine sahip bir <code>TextMetrics</code> nesnesi döndürür. Bu araç, ölçümden önce bağlamı yazı tipiniz, boyutunuz, ağırlığınız ve stilinizle yapılandırır.',
116
+ },
117
+ {
118
+ type: 'code',
119
+ ariaLabel: 'Canvas measureText örneği',
120
+ code: "const ctx = document.createElement('canvas').getContext('2d');\nctx.font = '700 16px Inter, system-ui, sans-serif';\nconst width = ctx.measureText('Merhaba Dünya').width; // örn. 74.5",
121
+ },
122
+ { type: 'title', level: 3, text: 'Gizlilik ve yerel işleme' },
123
+ {
124
+ type: 'paragraph',
125
+ html: 'Tüm hesaplamalar tarayıcınızda gerçekleşir. Cihazınızdan hiçbir metin, kod parçacığı veya özel veri çıkmaz.',
126
+ },
127
+ {
128
+ type: 'tip',
129
+ title: 'Google Fonts yazı tipleri',
130
+ html: 'Bir Google Fonts yazı tipini doğru bir şekilde ölçmek için önce sayfada yüklendiğinden veya sisteminizde yüklü olduğundan emin olun. Aksi takdirde tarayıcı yedek bir yazı tipine dönecektir ve sonuç farklı olacaktır.',
131
+ },
132
+ ],
133
+ };