Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off-by-one pre-defined pen and window styles for DTVCC/708 #14

Open
micolous opened this issue Oct 3, 2021 · 0 comments
Open

Off-by-one pre-defined pen and window styles for DTVCC/708 #14

micolous opened this issue Oct 3, 2021 · 0 comments

Comments

@micolous
Copy link

micolous commented Oct 3, 2021

CEA-708-E DefineWindow (DF0 - DF7) declares:

  • window style ID: when non-zero, specifies 1 of 7 present window attribute styles...
  • pen style ID: when non-zero, specifies 1 of 7 present pen attribute styles...

Tables 26 and 27 define these presets, starting at 1.

Caption Inspector interprets the window style IDs starting at 0:

const char* predefWinStyle[8] = {
"608-PopUp", "PopUp-TransBG", "PopUp-Cntrd", "608-RollUp", "RollUp-TransBG", "RollUp-Cntrd", "TickerTape", "Unknown"
};

And pen style IDs starting at 0:

const char* predefPenStyle[8] = {
"Default", "MonoSerif", "ProportSerif", "MonoSanSerif", "ProportSanSerif", "MonoSanSerif-TransBG", "ProportSanSerif-TransBG", "Unknown"
};

As a result, Caption Inspector interprets every window and pen style off-by-one, eg: Pen Style 5 (ProportSanSerif, NTSC Style Prop w/o Serif) is reported as MonoSanSerif-TransBG.

The fix would be to remove the "Unknown" value at the end of each of the predefPenStyle and predefWinStyle arrays, and replace it with an "Undefined" value at the start of each array.

Relatedly, WINDOW_STYLE_* defines are also incorrect, and start at 0 instead of 1:

#define WINDOW_STYLE_608_POPUP 0x00
#define WINDOW_STYLE_POPUP_TRANS_BG 0x01
#define WINDOW_STYLE_POPUP_CENTERED 0x02
#define WINDOW_STYLE_608_ROLLUP 0x03
#define WINDOW_STYLE_ROLLUP_TRANS_BG 0x04
#define WINDOW_STYLE_ROLLUP_CENTERED 0x05
#define WINDOW_STYLE_TICKER_TAPE 0x06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant