docs: Actualizar documentación TM-U220 con resultados de pruebas reales
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s

- Corregir caracteres por línea: Font A=33 (default), Font B=40
- Documentar que Font A es la fuente por defecto
- Agregar charset completo soportado (box drawing, bloques, símbolos)
- Documentar comandos que NO funcionan (textPosition, textSmooth, etc)
- Corregir sintaxis de operaciones (textAlign, textStyle, feedLine)
- Agregar nota: text NO tiene salto de línea automático
- Crear resultados-pruebas-tmu220.md con todas las pruebas
This commit is contained in:
2025-11-26 14:47:54 -06:00
parent e78c5f7062
commit 3105e83038
3 changed files with 588 additions and 150 deletions

View File

@@ -13,12 +13,17 @@ export const PRINTING_GUIDES: Record<string, {
type: string
columns: number
columnsDoubleWidth: number
columnsFontB?: number
columnsFontBDoubleWidth?: number
supportedChars: string
charsetDetails?: {
supported: string[]
notSupported: string[]
}
fonts?: Record<string, { columns: number; columnsDoubleWidth: number; description: string }>
rules: string[]
operationsSupported?: Record<string, { op: string; params: string; description: string }>
operationsNotSupported?: string[]
tips?: string[]
operations: string[]
example: string
@@ -26,66 +31,127 @@ export const PRINTING_GUIDES: Record<string, {
'TM-U220': {
model: 'Epson TM-U220',
type: 'Matricial (impact)',
columns: 40,
columnsDoubleWidth: 20,
supportedChars: 'Latin-1 extendido + Box Drawing + Bloques. NO emojis ni flechas Unicode.',
columns: 33,
columnsDoubleWidth: 16,
columnsFontB: 40,
columnsFontBDoubleWidth: 20,
supportedChars: 'ASCII + Latin-1 + Box Drawing + Bloques + Simbolos. Charset muy amplio.',
charsetDetails: {
supported: [
'ASCII completo: A-Z a-z 0-9 = - _ * + | / \\ ( ) [ ] < > " \' ` @ # % & ^ ~',
'ASCII completo: A-Z a-z 0-9 = - _ * + | / \\ ( ) [ ] < > " \' ` @ # $ % & ^ ~ , : . ; !',
'Box Drawing Doble: ╔ ╗ ╚ ╝ ║ ═',
'Box Drawing Simple: ┌ ┐ └ ┘ │ ─ ├ ┤ ┬ ┴ ┼',
'Bloques y Sombras: █ ▓ ▒ ░ ▀ ▄',
'Latinos extendidos: ñ Ñ á é í ó ú Á É Í Ó Ú ¿ ¡ ç',
'Monedas: $ € £ ¥',
'Matemáticos: ± × ÷ ≤ ≥ ∞'
'Flechas: ► ◄ ▲ ▼',
'Circulos: ● ○ ◘',
'Cartas: ♠ ♣ ♥ ♦',
'Latinos: ñ Ñ á é í ó ú ¿ ¡',
'Otros: ° ±'
],
notSupported: [
'Flechas Unicode: → ← ↑ ↓ ↔ ⇒ ⇐',
'Estrellas/Círculos: ★ ☆ ● ○ ◆ ◇',
'Emojis (todos): 😀 ❤ ✓ ✗ ☀ ☁ ✔ ✘',
'Específicos: ₿ (Bitcoin) ≠ (Distinto)'
'Emojis (todos)',
'Flechas thin Unicode: → ← ↑ ↓'
]
},
fonts: {
font_a: { columns: 33, columnsDoubleWidth: 16, description: 'Fuente normal (DEFAULT - se usa automaticamente)' },
font_b: { columns: 40, columnsDoubleWidth: 20, description: 'Fuente condensada (hay que activarla con textFont)' }
},
rules: [
'Máximo 40 caracteres por línea (20 con width:2)',
'Siempre usar feed entre elementos para legibilidad',
'feed:1 entre items, feed:2 entre secciones',
'feed:4 antes del cut final',
'Los headers con width:2 deben ser max 20 chars',
'╔══════════════════════════════════════════════════════════════╗',
'║ CARACTERES POR LINEA - LA FUENTE POR DEFECTO ES FONT A ║',
'╠══════════════════════════════════════════════════════════════╣',
'║ FONT A (DEFAULT): ║',
'║ - Normal (width:1): 33 caracteres por linea ║',
'║ - Doble ancho (width:2): 16 caracteres por linea ║',
'║ FONT B (condensada, hay que activarla con textFont): ║',
'║ - Normal (width:1): 40 caracteres por linea ║',
'║ - Doble ancho (width:2): 20 caracteres por linea ║',
'║ IMPORTANTE: height NO afecta la cantidad de caracteres ║',
'╚══════════════════════════════════════════════════════════════╝',
'Por defecto la impresora usa Font A, entonces el maximo es 33 chars',
'Para usar Font B: { "op": "textFont", "font": "font_b" }',
'=== REGLAS DE FORMATO ===',
'text NO tiene salto de linea automatico, usar feedLine despues de cada text',
'Siempre usar feedLine entre elementos para legibilidad',
'feedLine:1 entre items, feedLine:2 entre secciones',
'feedLine:4 antes del cut final',
'Solo usar cut SIN parametro type (cut con type da SchemaError)',
'Docs largos pueden dar EX_TIMEOUT pero se imprimen igual'
],
operationsSupported: {
text: { op: 'text', params: 'value: string', description: 'Imprime texto' },
textAlign: { op: 'textAlign', params: 'align: left|center|right', description: 'Alineacion' },
textFont: { op: 'textFont', params: 'font: font_a|font_b', description: 'Fuente (solo A y B funcionan)' },
textSize: { op: 'textSize', params: 'width: 1-2, height: 1-2', description: 'Tamano (max 2, valores >2 son igual a 2)' },
textStyle: { op: 'textStyle', params: 'em: bool, ul: bool', description: 'Solo bold y underline funcionan' },
textDouble: { op: 'textDouble', params: 'dw: bool, dh: bool', description: 'Alternativa a textSize' },
textRotate: { op: 'textRotate', params: 'rotate: bool', description: 'Solo 0 y 90 grados' },
textLineSpace: { op: 'textLineSpace', params: 'linespc: number', description: 'Espaciado entre lineas' },
feed: { op: 'feed', params: 'ninguno', description: 'Avance simple' },
feedLine: { op: 'feedLine', params: 'line: number', description: 'Avance N lineas' },
feedUnit: { op: 'feedUnit', params: 'unit: number', description: 'Avance en dots (mas preciso)' },
cut: { op: 'cut', params: 'ninguno', description: 'Corte (NO usar type, da error)' },
pulse: { op: 'pulse', params: 'drawer: drawer_1|drawer_2, time: pulse_100-500', description: 'Abrir cajon' }
},
operationsNotSupported: [
'textPosition (posicion X no funciona)',
'textVPosition (posicion Y no funciona)',
'textSmooth (sin efecto)',
'textLang (sin efecto, solo ASCII)',
'textStyle.reverse (no funciona)',
'textStyle.color (solo color_1/negro)',
'textFont font_c/d/e/special (sin efecto)',
'cut con type (SchemaError)',
'barcode (matricial no soporta)',
'qrcode (matricial no soporta)',
'imageRaw (matricial no soporta)'
],
tips: [
'TABLAS: Usar box drawing ┌─┬─┐ │ ├─┼─┤ └─┴─┘ para tablas legibles',
'TABLAS: Usar box drawing ┌─┬─┐ │ ├─┼─┤ └─┴─┘',
'BARRAS PROGRESO: Combinar █ y ░ ej: [█████░░░░░]',
'CAJAS: Box doble ╔═╗ ║ ╚═╝ para destacar contenido importante',
'BULLETS: Usar * - + > o [*] [X] en lugar de ✓ ✗',
'ASCII ART: Funciona perfecto con caracteres básicos'
'CAJAS: Box doble ╔═╗ ║ ╚═╝ para destacar',
'BULLETS: Usar ● ○ ► o [X] [ ]',
'ASCII ART: Funciona perfecto con todos los caracteres'
],
operations: [
'{ op: "text", value: "texto" } - Imprime texto',
'{ op: "feed", lines: N } - Avanza N líneas',
'{ op: "cut" } - Corta el papel',
'{ op: "align", align: "left|center|right" } - Alineación',
'{ op: "style", bold: true, underline: true, width: 1-2, height: 1-2 } - Estilos'
'{ op: "feedLine", line: N } - Avanza N lineas',
'{ op: "cut" } - Corta el papel (SIN type)',
'{ op: "textAlign", align: "left|center|right" } - Alineacion',
'{ op: "textFont", font: "font_a|font_b" } - Fuente',
'{ op: "textSize", width: 1-2, height: 1-2 } - Tamano',
'{ op: "textStyle", em: true, ul: true } - Bold y underline',
'{ op: "textRotate", rotate: true } - Rotar 90 grados',
'{ op: "pulse", drawer: "drawer_1", time: "pulse_100" } - Abrir cajon'
],
example: `[
{ "op": "align", "align": "center" },
{ "op": "style", "bold": true, "width": 2, "height": 2 },
{ "op": "textAlign", "align": "center" },
{ "op": "textSize", "width": 2, "height": 2 },
{ "op": "textStyle", "em": true },
{ "op": "text", "value": "TITULO" },
{ "op": "style", "bold": false, "width": 1, "height": 1 },
{ "op": "feed", "lines": 2 },
{ "op": "text", "value": "╔══════════════════════════════════════╗" },
{ "op": "text", "value": "║ Contenido importante aquí ║" },
{ "op": "text", "value": "╚══════════════════════════════════════╝" },
{ "op": "feed", "lines": 1 },
{ "op": "text", "value": "┌────────┬────────┬────────┐" },
{ "op": "text", "value": "│ COL 1 │ COL 2 │ COL 3 │" },
{ "op": "text", "value": "├────────┼────────┼────────┤" },
{ "op": "text", "value": "│ dato │ dato │ dato │" },
{ "op": "text", "value": "────────────────────────" },
{ "op": "feed", "lines": 1 },
{ "op": "text", "value": "Progreso: [██████████░░░░░░░░░░] 50%" },
{ "op": "feed", "lines": 4 },
{ "op": "textStyle", "em": false },
{ "op": "textSize", "width": 1, "height": 1 },
{ "op": "feedLine", "line": 2 },
{ "op": "text", "value": "╔═══════════════════════════════╗" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "║ Contenido importante ║" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "╚═══════════════════════════════╝" },
{ "op": "feedLine", "line": 1 },
{ "op": "textAlign", "align": "left" },
{ "op": "text", "value": "┌─────────────────────────────┐" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "│ COL 1 │ COL 2 │ COL 3 │" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "├──────────┼──────────┼─────────┤" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "│ dato │ dato │ dato │" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "└──────────┴──────────┴─────────┘" },
{ "op": "feedLine", "line": 1 },
{ "op": "text", "value": "Progreso: [████████░░░░░] 60%" },
{ "op": "feedLine", "line": 4 },
{ "op": "cut" }
]`
},
@@ -227,29 +293,49 @@ export const MCP_TOOLS = [
name: 'printercentral_print_raw',
description: `Imprime operaciones ePOS directamente. Útil para impresiones personalizadas sin crear un template.
FORMATO DE OPERACIONES (para impresora TM-U220, max 40 caracteres por línea):
- { op: "text", value: "texto" } - Imprime texto
- { op: "feed", lines: N } - Avanza N líneas (usar entre elementos para legibilidad)
- { op: "cut" } - Corta el papel
- { op: "align", align: "left|center|right" } - Alinea el texto
- { op: "style", bold: true/false, underline: true/false, width: 1-2, height: 1-2 } - Estilo de texto
╔═══════════════════════════════════════════════════════╗
║ CARACTERES POR LÍNEA - FONT A ES EL DEFAULT ║
╠═══════════════════════════════════════════════════════╣
║ FONT A (DEFAULT - no necesita textFont): ║
║ Normal (width:1): 33 caracteres ║
║ Doble ancho (width:2): 16 caracteres ║
║ FONT B (activar con textFont font_b): ║
║ Normal (width:1): 40 caracteres ║
║ Doble ancho (width:2): 20 caracteres ║
║ NOTA: height NO afecta cantidad de caracteres ║
╚═══════════════════════════════════════════════════════╝
DEFAULT = Font A = 33 chars max (o 16 con width:2)
OPERACIONES DISPONIBLES:
- { op: "text", value: "texto" } - Imprime texto (SIN salto de linea automatico)
- { op: "feedLine", line: N } - Avanza N líneas (SIEMPRE usar despues de text)
- { op: "cut" } - Corta papel (SIN parametro type)
- { op: "textAlign", align: "left|center|right" } - Alineación
- { op: "textFont", font: "font_a|font_b" } - Selecciona fuente
- { op: "textSize", width: 1-2, height: 1-2 } - Tamaño
- { op: "textStyle", em: true, ul: true } - Bold y underline
- { op: "textRotate", rotate: true } - Rotar 90°
- { op: "pulse", drawer: "drawer_1", time: "pulse_100" } - Abrir cajón
CHARSET SOPORTADO:
ASCII, Box Drawing (┌─┐│└┘╔═╗║╚╝), Bloques (█▓▒░▀▄), Símbolos (●○◘►◄▲▼♠♣♥♦), Latinos (ñáéíóú¿¡°±)
NO FUNCIONA en TM-U220:
textPosition, textVPosition, textSmooth, textLang, textStyle.reverse, textStyle.color (solo negro), cut con type, barcode, qrcode, imageRaw
EJEMPLO:
[
{ "op": "align", "align": "center" },
{ "op": "style", "bold": true, "width": 2, "height": 2 },
{ "op": "textAlign", "align": "center" },
{ "op": "textSize", "width": 2, "height": 2 },
{ "op": "textStyle", "em": true },
{ "op": "text", "value": "TITULO" },
{ "op": "style", "bold": false, "width": 1, "height": 1 },
{ "op": "feed", "lines": 2 },
{ "op": "textStyle", "em": false },
{ "op": "textSize", "width": 1, "height": 1 },
{ "op": "feedLine", "line": 2 },
{ "op": "text", "value": "Contenido aquí" },
{ "op": "feed", "lines": 4 },
{ "op": "feedLine", "line": 4 },
{ "op": "cut" }
]
REGLAS IMPORTANTES:
- Max 40 caracteres por línea (20 con width:2)
- Usar solo caracteres ASCII (evitar unicode especial)
- Siempre terminar con feed y cut`,
]`,
inputSchema: {
type: 'object' as const,
properties: {